libsodium-wrappers-sumo
Advanced tools
Comparing version 0.7.4 to 0.7.5
@@ -1,1 +0,1 @@ | ||
!function(e){function t(e,t){"use strict";var r,a="uint8array",n=t.ready.then(function(){function a(){if(0!==r._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var t=["crypto_aead_chacha20poly1305_decrypt","crypto_aead_chacha20poly1305_decrypt_detached","crypto_aead_chacha20poly1305_encrypt","crypto_aead_chacha20poly1305_encrypt_detached","crypto_aead_chacha20poly1305_ietf_decrypt","crypto_aead_chacha20poly1305_ietf_decrypt_detached","crypto_aead_chacha20poly1305_ietf_encrypt","crypto_aead_chacha20poly1305_ietf_encrypt_detached","crypto_aead_chacha20poly1305_ietf_keygen","crypto_aead_chacha20poly1305_keygen","crypto_aead_xchacha20poly1305_ietf_decrypt","crypto_aead_xchacha20poly1305_ietf_decrypt_detached","crypto_aead_xchacha20poly1305_ietf_encrypt","crypto_aead_xchacha20poly1305_ietf_encrypt_detached","crypto_aead_xchacha20poly1305_ietf_keygen","crypto_auth","crypto_auth_hmacsha256","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_generichash","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha512","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],a=[x,E,w,S,T,Y,A,K,B,I,M,L,N,U,O,R,P,C,G,D,X,V,F,H,j,z,W,J,q,Q,Z,$,ee,te,re,ae,ne,_e,se,ce,he,oe,pe,ye,ie,ue,le,ve,de,ge,be,fe,me,ke,xe,Ee,we,Se,Te,Ye,Ae,Ke,Be,Ie,Me,Le,Ne,Ue,Oe,Re,Pe,Ce,Ge,De,Xe,Ve,Fe,He,je,ze,We,Je,qe,Qe,Ze,$e,et,tt,rt,at,nt,_t,st,ct,ht,ot,pt,yt,it,ut,lt,vt,dt,gt,bt,ft,mt,kt,xt,Et,wt,St,Tt],n=0;n<a.length;n++)"function"==typeof r["_"+t[n]]&&(e[t[n]]=a[n]);var _=["SODIUM_LIBRARY_VERSION_MAJOR","SODIUM_LIBRARY_VERSION_MINOR","crypto_aead_chacha20poly1305_ABYTES","crypto_aead_chacha20poly1305_KEYBYTES","crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX","crypto_aead_chacha20poly1305_NPUBBYTES","crypto_aead_chacha20poly1305_NSECBYTES","crypto_aead_chacha20poly1305_ietf_ABYTES","crypto_aead_chacha20poly1305_ietf_KEYBYTES","crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX","crypto_aead_chacha20poly1305_ietf_NPUBBYTES","crypto_aead_chacha20poly1305_ietf_NSECBYTES","crypto_aead_xchacha20poly1305_ietf_ABYTES","crypto_aead_xchacha20poly1305_ietf_KEYBYTES","crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX","crypto_aead_xchacha20poly1305_ietf_NPUBBYTES","crypto_aead_xchacha20poly1305_ietf_NSECBYTES","crypto_auth_BYTES","crypto_auth_KEYBYTES","crypto_auth_hmacsha256_BYTES","crypto_auth_hmacsha256_KEYBYTES","crypto_auth_hmacsha512_BYTES","crypto_auth_hmacsha512_KEYBYTES","crypto_box_BEFORENMBYTES","crypto_box_MACBYTES","crypto_box_MESSAGEBYTES_MAX","crypto_box_NONCEBYTES","crypto_box_PUBLICKEYBYTES","crypto_box_SEALBYTES","crypto_box_SECRETKEYBYTES","crypto_box_SEEDBYTES","crypto_box_curve25519xchacha20poly1305_NONCEBYTES","crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES","crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES","crypto_core_hchacha20_CONSTBYTES","crypto_core_hchacha20_INPUTBYTES","crypto_core_hchacha20_KEYBYTES","crypto_core_hchacha20_OUTPUTBYTES","crypto_generichash_BYTES","crypto_generichash_BYTES_MAX","crypto_generichash_BYTES_MIN","crypto_generichash_KEYBYTES","crypto_generichash_KEYBYTES_MAX","crypto_generichash_KEYBYTES_MIN","crypto_hash_BYTES","crypto_hash_sha256_BYTES","crypto_hash_sha512_BYTES","crypto_kdf_BYTES_MAX","crypto_kdf_BYTES_MIN","crypto_kdf_CONTEXTBYTES","crypto_kdf_KEYBYTES","crypto_kx_PUBLICKEYBYTES","crypto_kx_SECRETKEYBYTES","crypto_kx_SEEDBYTES","crypto_kx_SESSIONKEYBYTES","crypto_onetimeauth_BYTES","crypto_onetimeauth_KEYBYTES","crypto_pwhash_ALG_ARGON2I13","crypto_pwhash_ALG_ARGON2ID13","crypto_pwhash_ALG_DEFAULT","crypto_pwhash_BYTES_MAX","crypto_pwhash_BYTES_MIN","crypto_pwhash_MEMLIMIT_INTERACTIVE","crypto_pwhash_MEMLIMIT_MAX","crypto_pwhash_MEMLIMIT_MIN","crypto_pwhash_MEMLIMIT_MODERATE","crypto_pwhash_MEMLIMIT_SENSITIVE","crypto_pwhash_OPSLIMIT_INTERACTIVE","crypto_pwhash_OPSLIMIT_MAX","crypto_pwhash_OPSLIMIT_MIN","crypto_pwhash_OPSLIMIT_MODERATE","crypto_pwhash_OPSLIMIT_SENSITIVE","crypto_pwhash_PASSWD_MAX","crypto_pwhash_PASSWD_MIN","crypto_pwhash_SALTBYTES","crypto_pwhash_STRBYTES","crypto_pwhash_STR_VERIFY","crypto_pwhash_scryptsalsa208sha256_BYTES_MAX","crypto_pwhash_scryptsalsa208sha256_BYTES_MIN","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE","crypto_pwhash_scryptsalsa208sha256_SALTBYTES","crypto_pwhash_scryptsalsa208sha256_STRBYTES","crypto_pwhash_scryptsalsa208sha256_STR_VERIFY","crypto_scalarmult_BYTES","crypto_scalarmult_SCALARBYTES","crypto_secretbox_KEYBYTES","crypto_secretbox_MACBYTES","crypto_secretbox_MESSAGEBYTES_MAX","crypto_secretbox_NONCEBYTES","crypto_secretstream_xchacha20poly1305_ABYTES","crypto_secretstream_xchacha20poly1305_HEADERBYTES","crypto_secretstream_xchacha20poly1305_KEYBYTES","crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretstream_xchacha20poly1305_MESSAGESBYTES_MAX","crypto_secretstream_xchacha20poly1305_NPUBBYTES","crypto_secretstream_xchacha20poly1305_TAG_FINAL","crypto_secretstream_xchacha20poly1305_TAG_MESSAGE","crypto_secretstream_xchacha20poly1305_TAG_PUSH","crypto_secretstream_xchacha20poly1305_TAG_REKEY","crypto_shorthash_BYTES","crypto_shorthash_KEYBYTES","crypto_shorthash_siphashx24_BYTES","crypto_shorthash_siphashx24_KEYBYTES","crypto_sign_BYTES","crypto_sign_MESSAGEBYTES_MAX","crypto_sign_PUBLICKEYBYTES","crypto_sign_SECRETKEYBYTES","crypto_sign_SEEDBYTES","crypto_stream_KEYBYTES","crypto_stream_MESSAGEBYTES_MAX","crypto_stream_NONCEBYTES","crypto_stream_chacha20_KEYBYTES","crypto_stream_chacha20_NONCEBYTES","crypto_stream_chacha20_ietf_KEYBYTES","crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX","crypto_stream_chacha20_ietf_NONCEBYTES","crypto_stream_xchacha20_KEYBYTES","crypto_stream_xchacha20_MESSAGEBYTES_MAX","crypto_stream_xchacha20_NONCEBYTES","randombytes_SEEDBYTES"];for(n=0;n<_.length;n++)"function"==typeof(c=r["_"+_[n].toLowerCase()])&&(e[_[n]]=c());var s=["SODIUM_VERSION_STRING","crypto_pwhash_STRPREFIX","crypto_pwhash_scryptsalsa208sha256_STRPREFIX"];for(n=0;n<s.length;n++){var c;"function"==typeof(c=r["_"+s[n].toLowerCase()])&&(e[s[n]]=r.Pointer_stringify(c()))}}r=t;try{a();var n=new Uint8Array([98,97,108,108,115]),_=e.randombytes_buf(e.crypto_secretbox_NONCEBYTES),s=e.randombytes_buf(e.crypto_secretbox_KEYBYTES),c=e.crypto_secretbox_easy(n,_,s),h=e.crypto_secretbox_open_easy(c,_,s);if(e.memcmp(n,h))return}catch(e){}r.useBackupModule(),a()});function _(e){if("function"==typeof TextEncoder)return new TextEncoder("utf-8").encode(e);e=unescape(encodeURIComponent(e));for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function s(e){if("function"==typeof TextDecoder)return new TextDecoder("utf-8",{fatal:!0}).decode(e);var t=Math.ceil(e.length/8192);if(t<=1)try{return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}catch(e){throw new TypeError("The encoded data was not valid.")}for(var r="",a=0,n=0;n<t;n++){var _=Array.prototype.slice.call(e,8192*n+a,8192*(n+1)+a);if(0!=_.length){var c,h=_.length,o=0;do{var p=_[--h];p>=240?(o=4,c=!0):p>=224?(o=3,c=!0):p>=192?(o=2,c=!0):p<128&&(o=1,c=!0)}while(!c);for(var y=o-(_.length-h),i=0;i<y;i++)a--,_.pop();r+=s(_)}}return r}function c(e){e=k(null,e,"input");for(var t,r,a,n="",_=0;_<e.length;_++)a=87+(r=15&e[_])+(r-10>>8&-39)<<8|87+(t=e[_]>>>4)+(t-10>>8&-39),n+=String.fromCharCode(255&a)+String.fromCharCode(a>>>8);return n}var h={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function o(e){if(void 0==e)return h.URLSAFE_NO_PADDING;if(e!==h.ORIGINAL&&e!==h.ORIGINAL_NO_PADDING&&e!==h.URLSAFE&&e!=h.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function p(e,t){t=o(t),e=k(n,e,"input");var a,n=[],_=0|Math.floor(e.length/3),c=e.length-3*_,h=4*_+(0!==c?0==(2&t)?4:2+(c>>>1):0),p=new l(h+1),y=v(e);return n.push(y),n.push(p.address),0===r._sodium_bin2base64(p.address,p.length,y,e.length,t)&&b(n,"conversion failed"),p.length=h,a=s(p.to_Uint8Array()),g(n),a}function y(e,t){var r=t||a;if(!i(r))throw new Error(r+" output format is not available");if(e instanceof l){if("uint8array"===r)return e.to_Uint8Array();if("text"===r)return s(e.to_Uint8Array());if("hex"===r)return c(e.to_Uint8Array());if("base64"===r)return p(e.to_Uint8Array(),h.URLSAFE_NO_PADDING);throw new Error('What is output format "'+r+'"?')}if("object"==typeof e){for(var n=Object.keys(e),_={},o=0;o<n.length;o++)_[n[o]]=y(e[n[o]],r);return _}if("string"==typeof e)return e;throw new TypeError("Cannot format output")}function i(e){for(var t=["uint8array","text","hex","base64"],r=0;r<t.length;r++)if(t[r]===e)return!0;return!1}function u(e){if(e){if("string"!=typeof e)throw new TypeError("When defined, the output format must be a string");if(!i(e))throw new Error(e+" is not a supported output format")}}function l(e){this.length=e,this.address=d(e)}function v(e){var t=d(e.length);return r.HEAPU8.set(e,t),t}function d(e){var t=r._malloc(e);if(0===t)throw{message:"_malloc() failed",length:e};return t}function g(e){if(e)for(var t=0;t<e.length;t++)a=e[t],r._free(a);var a}function b(e,t){throw g(e),new Error(t)}function f(e,t){throw g(e),new TypeError(t)}function m(e,t,r){void 0==t&&f(e,r+" cannot be null or undefined")}function k(e,t,r){return m(e,t,r),t instanceof Uint8Array?t:"string"==typeof t?_(t):void f(e,"unsupported input type for "+r)}function x(e,t,a,n,_,s){var c=[];u(s);var h=null;void 0!=e&&(h=v(e=k(c,e,"secret_nonce")),e.length,c.push(h)),t=k(c,t,"ciphertext");var o,p=r._crypto_aead_chacha20poly1305_abytes(),i=t.length;i<p&&f(c,"ciphertext is too short"),o=v(t),c.push(o);var d=null,m=0;void 0!=a&&(d=v(a=k(c,a,"additional_data")),m=a.length,c.push(d)),n=k(c,n,"public_nonce");var x,E=0|r._crypto_aead_chacha20poly1305_npubbytes();n.length!==E&&f(c,"invalid public_nonce length"),x=v(n),c.push(x),_=k(c,_,"key");var w,S=0|r._crypto_aead_chacha20poly1305_keybytes();_.length!==S&&f(c,"invalid key length"),w=v(_),c.push(w);var T=new l(i-r._crypto_aead_chacha20poly1305_abytes()|0),Y=T.address;if(c.push(Y),0===r._crypto_aead_chacha20poly1305_decrypt(Y,null,h,o,i,0,d,m,0,x,w)){var A=y(T,s);return g(c),A}b(c,"invalid usage")}function E(e,t,a,n,_,s,c){var h=[];u(c);var o=null;void 0!=e&&(o=v(e=k(h,e,"secret_nonce")),e.length,h.push(o));var p=v(t=k(h,t,"ciphertext")),i=t.length;h.push(p),a=k(h,a,"mac");var d,m=0|r._crypto_box_macbytes();a.length!==m&&f(h,"invalid mac length"),d=v(a),h.push(d);var x=null,E=0;void 0!=n&&(x=v(n=k(h,n,"additional_data")),E=n.length,h.push(x)),_=k(h,_,"public_nonce");var w,S=0|r._crypto_aead_chacha20poly1305_npubbytes();_.length!==S&&f(h,"invalid public_nonce length"),w=v(_),h.push(w),s=k(h,s,"key");var T,Y=0|r._crypto_aead_chacha20poly1305_keybytes();s.length!==Y&&f(h,"invalid key length"),T=v(s),h.push(T);var A=new l(0|i),K=A.address;if(h.push(K),0===r._crypto_aead_chacha20poly1305_decrypt_detached(K,o,p,i,0,d,x,E,0,w,T)){var B=y(A,c);return g(h),B}b(h,"invalid usage")}function w(e,t,a,n,_,s){var c=[];u(s);var h=v(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;void 0!=t&&(p=v(t=k(c,t,"additional_data")),i=t.length,c.push(p));var d=null;void 0!=a&&(d=v(a=k(c,a,"secret_nonce")),a.length,c.push(d)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=v(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_chacha20poly1305_keybytes();_.length!==w&&f(c,"invalid key length"),E=v(_),c.push(E);var S=new l(o+r._crypto_aead_chacha20poly1305_abytes()|0),T=S.address;if(c.push(T),0===r._crypto_aead_chacha20poly1305_encrypt(T,null,h,o,0,p,i,0,d,m,E)){var Y=y(S,s);return g(c),Y}b(c,"invalid usage")}function S(e,t,a,n,_,s){var c=[];u(s);var h=v(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;void 0!=t&&(p=v(t=k(c,t,"additional_data")),i=t.length,c.push(p));var d=null;void 0!=a&&(d=v(a=k(c,a,"secret_nonce")),a.length,c.push(d)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=v(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_chacha20poly1305_keybytes();_.length!==w&&f(c,"invalid key length"),E=v(_),c.push(E);var S=new l(0|o),T=S.address;c.push(T);var Y=new l(0|r._crypto_aead_chacha20poly1305_abytes()),A=Y.address;if(c.push(A),0===r._crypto_aead_chacha20poly1305_encrypt_detached(T,A,null,h,o,0,p,i,0,d,m,E)){var K=y({ciphertext:S,mac:Y},s);return g(c),K}b(c,"invalid usage")}function T(e,t,a,n,_,s){var c=[];u(s);var h=null;void 0!=e&&(h=v(e=k(c,e,"secret_nonce")),e.length,c.push(h)),t=k(c,t,"ciphertext");var o,p=r._crypto_aead_chacha20poly1305_ietf_abytes(),i=t.length;i<p&&f(c,"ciphertext is too short"),o=v(t),c.push(o);var d=null,m=0;void 0!=a&&(d=v(a=k(c,a,"additional_data")),m=a.length,c.push(d)),n=k(c,n,"public_nonce");var x,E=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();n.length!==E&&f(c,"invalid public_nonce length"),x=v(n),c.push(x),_=k(c,_,"key");var w,S=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();_.length!==S&&f(c,"invalid key length"),w=v(_),c.push(w);var T=new l(i-r._crypto_aead_chacha20poly1305_ietf_abytes()|0),Y=T.address;if(c.push(Y),0===r._crypto_aead_chacha20poly1305_ietf_decrypt(Y,null,h,o,i,0,d,m,0,x,w)){var A=y(T,s);return g(c),A}b(c,"invalid usage")}function Y(e,t,a,n,_,s,c){var h=[];u(c);var o=null;void 0!=e&&(o=v(e=k(h,e,"secret_nonce")),e.length,h.push(o));var p=v(t=k(h,t,"ciphertext")),i=t.length;h.push(p),a=k(h,a,"mac");var d,m=0|r._crypto_box_macbytes();a.length!==m&&f(h,"invalid mac length"),d=v(a),h.push(d);var x=null,E=0;void 0!=n&&(x=v(n=k(h,n,"additional_data")),E=n.length,h.push(x)),_=k(h,_,"public_nonce");var w,S=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==S&&f(h,"invalid public_nonce length"),w=v(_),h.push(w),s=k(h,s,"key");var T,Y=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==Y&&f(h,"invalid key length"),T=v(s),h.push(T);var A=new l(0|i),K=A.address;if(h.push(K),0===r._crypto_aead_chacha20poly1305_ietf_decrypt_detached(K,o,p,i,0,d,x,E,0,w,T)){var B=y(A,c);return g(h),B}b(h,"invalid usage")}function A(e,t,a,n,_,s){var c=[];u(s);var h=v(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;void 0!=t&&(p=v(t=k(c,t,"additional_data")),i=t.length,c.push(p));var d=null;void 0!=a&&(d=v(a=k(c,a,"secret_nonce")),a.length,c.push(d)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=v(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();_.length!==w&&f(c,"invalid key length"),E=v(_),c.push(E);var S=new l(o+r._crypto_aead_chacha20poly1305_ietf_abytes()|0),T=S.address;if(c.push(T),0===r._crypto_aead_chacha20poly1305_ietf_encrypt(T,null,h,o,0,p,i,0,d,m,E)){var Y=y(S,s);return g(c),Y}b(c,"invalid usage")}function K(e,t,a,n,_,s){var c=[];u(s);var h=v(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;void 0!=t&&(p=v(t=k(c,t,"additional_data")),i=t.length,c.push(p));var d=null;void 0!=a&&(d=v(a=k(c,a,"secret_nonce")),a.length,c.push(d)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=v(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();_.length!==w&&f(c,"invalid key length"),E=v(_),c.push(E);var S=new l(0|o),T=S.address;c.push(T);var Y=new l(0|r._crypto_aead_chacha20poly1305_ietf_abytes()),A=Y.address;if(c.push(A),0===r._crypto_aead_chacha20poly1305_ietf_encrypt_detached(T,A,null,h,o,0,p,i,0,d,m,E)){var K=y({ciphertext:S,mac:Y},s);return g(c),K}b(c,"invalid usage")}function B(e){var t=[];u(e);var a=new l(0|r._crypto_aead_chacha20poly1305_ietf_keybytes()),n=a.address;t.push(n),r._crypto_aead_chacha20poly1305_ietf_keygen(n);var _=y(a,e);return g(t),_}function I(e){var t=[];u(e);var a=new l(0|r._crypto_aead_chacha20poly1305_keybytes()),n=a.address;t.push(n),r._crypto_aead_chacha20poly1305_keygen(n);var _=y(a,e);return g(t),_}function M(e,t,a,n,_,s){var c=[];u(s);var h=null;void 0!=e&&(h=v(e=k(c,e,"secret_nonce")),e.length,c.push(h)),t=k(c,t,"ciphertext");var o,p=r._crypto_aead_xchacha20poly1305_ietf_abytes(),i=t.length;i<p&&f(c,"ciphertext is too short"),o=v(t),c.push(o);var d=null,m=0;void 0!=a&&(d=v(a=k(c,a,"additional_data")),m=a.length,c.push(d)),n=k(c,n,"public_nonce");var x,E=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();n.length!==E&&f(c,"invalid public_nonce length"),x=v(n),c.push(x),_=k(c,_,"key");var w,S=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();_.length!==S&&f(c,"invalid key length"),w=v(_),c.push(w);var T=new l(i-r._crypto_aead_xchacha20poly1305_ietf_abytes()|0),Y=T.address;if(c.push(Y),0===r._crypto_aead_xchacha20poly1305_ietf_decrypt(Y,null,h,o,i,0,d,m,0,x,w)){var A=y(T,s);return g(c),A}b(c,"invalid usage")}function L(e,t,a,n,_,s,c){var h=[];u(c);var o=null;void 0!=e&&(o=v(e=k(h,e,"secret_nonce")),e.length,h.push(o));var p=v(t=k(h,t,"ciphertext")),i=t.length;h.push(p),a=k(h,a,"mac");var d,m=0|r._crypto_box_macbytes();a.length!==m&&f(h,"invalid mac length"),d=v(a),h.push(d);var x=null,E=0;void 0!=n&&(x=v(n=k(h,n,"additional_data")),E=n.length,h.push(x)),_=k(h,_,"public_nonce");var w,S=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==S&&f(h,"invalid public_nonce length"),w=v(_),h.push(w),s=k(h,s,"key");var T,Y=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==Y&&f(h,"invalid key length"),T=v(s),h.push(T);var A=new l(0|i),K=A.address;if(h.push(K),0===r._crypto_aead_xchacha20poly1305_ietf_decrypt_detached(K,o,p,i,0,d,x,E,0,w,T)){var B=y(A,c);return g(h),B}b(h,"invalid usage")}function N(e,t,a,n,_,s){var c=[];u(s);var h=v(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;void 0!=t&&(p=v(t=k(c,t,"additional_data")),i=t.length,c.push(p));var d=null;void 0!=a&&(d=v(a=k(c,a,"secret_nonce")),a.length,c.push(d)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=v(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();_.length!==w&&f(c,"invalid key length"),E=v(_),c.push(E);var S=new l(o+r._crypto_aead_xchacha20poly1305_ietf_abytes()|0),T=S.address;if(c.push(T),0===r._crypto_aead_xchacha20poly1305_ietf_encrypt(T,null,h,o,0,p,i,0,d,m,E)){var Y=y(S,s);return g(c),Y}b(c,"invalid usage")}function U(e,t,a,n,_,s){var c=[];u(s);var h=v(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;void 0!=t&&(p=v(t=k(c,t,"additional_data")),i=t.length,c.push(p));var d=null;void 0!=a&&(d=v(a=k(c,a,"secret_nonce")),a.length,c.push(d)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=v(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();_.length!==w&&f(c,"invalid key length"),E=v(_),c.push(E);var S=new l(0|o),T=S.address;c.push(T);var Y=new l(0|r._crypto_aead_xchacha20poly1305_ietf_abytes()),A=Y.address;if(c.push(A),0===r._crypto_aead_xchacha20poly1305_ietf_encrypt_detached(T,A,null,h,o,0,p,i,0,d,m,E)){var K=y({ciphertext:S,mac:Y},s);return g(c),K}b(c,"invalid usage")}function O(e){var t=[];u(e);var a=new l(0|r._crypto_aead_xchacha20poly1305_ietf_keybytes()),n=a.address;t.push(n),r._crypto_aead_xchacha20poly1305_ietf_keygen(n);var _=y(a,e);return g(t),_}function R(e,t,a){var n=[];u(a);var _=v(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_auth_keybytes();t.length!==h&&f(n,"invalid key length"),c=v(t),n.push(c);var o=new l(0|r._crypto_auth_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_auth(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function P(e,t,a){var n=[];u(a);var _=v(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_auth_hmacsha256_keybytes();t.length!==h&&f(n,"invalid key length"),c=v(t),n.push(c);var o=new l(0|r._crypto_auth_hmacsha256_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_auth_hmacsha256(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function C(e){var t=[];u(e);var a=new l(0|r._crypto_auth_hmacsha256_keybytes()),n=a.address;t.push(n),r._crypto_auth_hmacsha256_keygen(n);var _=y(a,e);return g(t),_}function G(e,t,a){var n=[];e=k(n,e,"tag");var _,s=0|r._crypto_auth_hmacsha256_bytes();e.length!==s&&f(n,"invalid tag length"),_=v(e),n.push(_);var c=v(t=k(n,t,"message")),h=t.length;n.push(c),a=k(n,a,"key");var o,p=0|r._crypto_auth_hmacsha256_keybytes();a.length!==p&&f(n,"invalid key length"),o=v(a),n.push(o);var y=0==(0|r._crypto_auth_hmacsha256_verify(_,c,h,0,o));return g(n),y}function D(e,t,a){var n=[];u(a);var _=v(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_auth_hmacsha512_keybytes();t.length!==h&&f(n,"invalid key length"),c=v(t),n.push(c);var o=new l(0|r._crypto_auth_hmacsha512_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_auth_hmacsha512(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function X(e){var t=[];u(e);var a=new l(0|r._crypto_auth_hmacsha512_keybytes()),n=a.address;t.push(n),r._crypto_auth_hmacsha512_keygen(n);var _=y(a,e);return g(t),_}function V(e,t,a){var n=[];e=k(n,e,"tag");var _,s=0|r._crypto_auth_hmacsha512_bytes();e.length!==s&&f(n,"invalid tag length"),_=v(e),n.push(_);var c=v(t=k(n,t,"message")),h=t.length;n.push(c),a=k(n,a,"key");var o,p=0|r._crypto_auth_hmacsha512_keybytes();a.length!==p&&f(n,"invalid key length"),o=v(a),n.push(o);var y=0==(0|r._crypto_auth_hmacsha512_verify(_,c,h,0,o));return g(n),y}function F(e){var t=[];u(e);var a=new l(0|r._crypto_auth_keybytes()),n=a.address;t.push(n),r._crypto_auth_keygen(n);var _=y(a,e);return g(t),_}function H(e,t,a){var n=[];e=k(n,e,"tag");var _,s=0|r._crypto_auth_bytes();e.length!==s&&f(n,"invalid tag length"),_=v(e),n.push(_);var c=v(t=k(n,t,"message")),h=t.length;n.push(c),a=k(n,a,"key");var o,p=0|r._crypto_auth_keybytes();a.length!==p&&f(n,"invalid key length"),o=v(a),n.push(o);var y=0==(0|r._crypto_auth_verify(_,c,h,0,o));return g(n),y}function j(e,t,a){var n=[];u(a),e=k(n,e,"publicKey");var _,s=0|r._crypto_box_publickeybytes();e.length!==s&&f(n,"invalid publicKey length"),_=v(e),n.push(_),t=k(n,t,"privateKey");var c,h=0|r._crypto_box_secretkeybytes();t.length!==h&&f(n,"invalid privateKey length"),c=v(t),n.push(c);var o=new l(0|r._crypto_box_beforenmbytes()),p=o.address;if(n.push(p),0==(0|r._crypto_box_beforenm(p,_,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function z(e){var t=[];u(e);var a=new l(0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes()),n=a.address;t.push(n);var _=new l(0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes()),s=_.address;t.push(s),r._crypto_box_curve25519xchacha20poly1305_keypair(n,s);var c=y({publicKey:a,privateKey:_,keyType:"curve25519"},e);return g(t),c}function W(e,t,a){var n=[];u(a);var _=v(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"publicKey");var c,h=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==h&&f(n,"invalid publicKey length"),c=v(t),n.push(c);var o=new l(s+r._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),p=o.address;n.push(p),r._crypto_box_curve25519xchacha20poly1305_seal(p,_,s,0,c);var i=y(o,a);return g(n),i}function J(e,t,a,n){var _=[];u(n),e=k(_,e,"ciphertext");var s,c=r._crypto_box_curve25519xchacha20poly1305_sealbytes(),h=e.length;h<c&&f(_,"ciphertext is too short"),s=v(e),_.push(s),t=k(_,t,"publicKey");var o,p=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==p&&f(_,"invalid publicKey length"),o=v(t),_.push(o),a=k(_,a,"secretKey");var i,d=0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes();a.length!==d&&f(_,"invalid secretKey length"),i=v(a),_.push(i);var b=new l(h-r._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),m=b.address;_.push(m),r._crypto_box_curve25519xchacha20poly1305_seal_open(m,s,h,0,o,i);var x=y(b,n);return g(_),x}function q(e,t,a,n,_){var s=[];u(_);var c=v(e=k(s,e,"message")),h=e.length;s.push(c),t=k(s,t,"nonce");var o,p=0|r._crypto_box_noncebytes();t.length!==p&&f(s,"invalid nonce length"),o=v(t),s.push(o),a=k(s,a,"publicKey");var i,d=0|r._crypto_box_publickeybytes();a.length!==d&&f(s,"invalid publicKey length"),i=v(a),s.push(i),n=k(s,n,"privateKey");var m,x=0|r._crypto_box_secretkeybytes();n.length!==x&&f(s,"invalid privateKey length"),m=v(n),s.push(m);var E=new l(0|h),w=E.address;s.push(w);var S=new l(0|r._crypto_box_macbytes()),T=S.address;if(s.push(T),0==(0|r._crypto_box_detached(w,T,c,h,0,o,i,m))){var Y=y({ciphertext:E,mac:S},_);return g(s),Y}b(s,"invalid usage")}function Q(e,t,a,n,_){var s=[];u(_);var c=v(e=k(s,e,"message")),h=e.length;s.push(c),t=k(s,t,"nonce");var o,p=0|r._crypto_box_noncebytes();t.length!==p&&f(s,"invalid nonce length"),o=v(t),s.push(o),a=k(s,a,"publicKey");var i,d=0|r._crypto_box_publickeybytes();a.length!==d&&f(s,"invalid publicKey length"),i=v(a),s.push(i),n=k(s,n,"privateKey");var m,x=0|r._crypto_box_secretkeybytes();n.length!==x&&f(s,"invalid privateKey length"),m=v(n),s.push(m);var E=new l(h+r._crypto_box_macbytes()|0),w=E.address;if(s.push(w),0==(0|r._crypto_box_easy(w,c,h,0,o,i,m))){var S=y(E,_);return g(s),S}b(s,"invalid usage")}function Z(e,t,a,n){var _=[];u(n);var s=v(e=k(_,e,"message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_box_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=v(t),_.push(h),a=k(_,a,"sharedKey");var p,i=0|r._crypto_box_beforenmbytes();a.length!==i&&f(_,"invalid sharedKey length"),p=v(a),_.push(p);var d=new l(c+r._crypto_box_macbytes()|0),m=d.address;if(_.push(m),0==(0|r._crypto_box_easy_afternm(m,s,c,0,h,p))){var x=y(d,n);return g(_),x}b(_,"invalid usage")}function $(e){var t=[];u(e);var a=new l(0|r._crypto_box_publickeybytes()),n=a.address;t.push(n);var _=new l(0|r._crypto_box_secretkeybytes()),s=_.address;if(t.push(s),0==(0|r._crypto_box_keypair(n,s))){var c={publicKey:y(a,e),privateKey:y(_,e),keyType:"x25519"};return g(t),c}b(t,"internal error")}function ee(e,t,a,n,_,s){var c=[];u(s);var h=v(e=k(c,e,"ciphertext")),o=e.length;c.push(h),t=k(c,t,"mac");var p,i=0|r._crypto_box_macbytes();t.length!==i&&f(c,"invalid mac length"),p=v(t),c.push(p),a=k(c,a,"nonce");var d,m=0|r._crypto_box_noncebytes();a.length!==m&&f(c,"invalid nonce length"),d=v(a),c.push(d),n=k(c,n,"publicKey");var x,E=0|r._crypto_box_publickeybytes();n.length!==E&&f(c,"invalid publicKey length"),x=v(n),c.push(x),_=k(c,_,"privateKey");var w,S=0|r._crypto_box_secretkeybytes();_.length!==S&&f(c,"invalid privateKey length"),w=v(_),c.push(w);var T=new l(0|o),Y=T.address;if(c.push(Y),0==(0|r._crypto_box_open_detached(Y,h,p,o,0,d,x,w))){var A=y(T,s);return g(c),A}b(c,"incorrect key pair for the given ciphertext")}function te(e,t,a,n,_){var s=[];u(_),e=k(s,e,"ciphertext");var c,h=r._crypto_box_macbytes(),o=e.length;o<h&&f(s,"ciphertext is too short"),c=v(e),s.push(c),t=k(s,t,"nonce");var p,i=0|r._crypto_box_noncebytes();t.length!==i&&f(s,"invalid nonce length"),p=v(t),s.push(p),a=k(s,a,"publicKey");var d,m=0|r._crypto_box_publickeybytes();a.length!==m&&f(s,"invalid publicKey length"),d=v(a),s.push(d),n=k(s,n,"privateKey");var x,E=0|r._crypto_box_secretkeybytes();n.length!==E&&f(s,"invalid privateKey length"),x=v(n),s.push(x);var w=new l(o-r._crypto_box_macbytes()|0),S=w.address;if(s.push(S),0==(0|r._crypto_box_open_easy(S,c,o,0,p,d,x))){var T=y(w,_);return g(s),T}b(s,"incorrect key pair for the given ciphertext")}function re(e,t,a,n){var _=[];u(n);var s=v(e=k(_,e,"ciphertext")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_box_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=v(t),_.push(h),a=k(_,a,"sharedKey");var p,i=0|r._crypto_box_beforenmbytes();a.length!==i&&f(_,"invalid sharedKey length"),p=v(a),_.push(p);var d=new l(c-r._crypto_box_macbytes()|0),m=d.address;if(_.push(m),0==(0|r._crypto_box_open_easy_afternm(m,s,c,0,h,p))){var x=y(d,n);return g(_),x}b(_,"incorrect secret key for the given ciphertext")}function ae(e,t,a){var n=[];u(a);var _=v(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"publicKey");var c,h=0|r._crypto_box_publickeybytes();t.length!==h&&f(n,"invalid publicKey length"),c=v(t),n.push(c);var o=new l(s+r._crypto_box_sealbytes()|0),p=o.address;if(n.push(p),0==(0|r._crypto_box_seal(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function ne(e,t,a,n){var _=[];u(n),e=k(_,e,"ciphertext");var s,c=r._crypto_box_sealbytes(),h=e.length;h<c&&f(_,"ciphertext is too short"),s=v(e),_.push(s),t=k(_,t,"publicKey");var o,p=0|r._crypto_box_publickeybytes();t.length!==p&&f(_,"invalid publicKey length"),o=v(t),_.push(o),a=k(_,a,"privateKey");var i,d=0|r._crypto_box_secretkeybytes();a.length!==d&&f(_,"invalid privateKey length"),i=v(a),_.push(i);var m=new l(h-r._crypto_box_sealbytes()|0),x=m.address;if(_.push(x),0==(0|r._crypto_box_seal_open(x,s,h,0,o,i))){var E=y(m,n);return g(_),E}b(_,"incorrect key pair for the given ciphertext")}function _e(e,t){var a=[];u(t),e=k(a,e,"seed");var n,_=0|r._crypto_box_seedbytes();e.length!==_&&f(a,"invalid seed length"),n=v(e),a.push(n);var s=new l(0|r._crypto_box_publickeybytes()),c=s.address;a.push(c);var h=new l(0|r._crypto_box_secretkeybytes()),o=h.address;if(a.push(o),0==(0|r._crypto_box_seed_keypair(c,o,n))){var p={publicKey:y(s,t),privateKey:y(h,t),keyType:"x25519"};return g(a),p}b(a,"invalid usage")}function se(e,t,a,n){var _=[];u(n),m(_,e,"hash_length"),("number"!=typeof e||(0|e)!==e||e<0)&&f(_,"hash_length must be an unsigned integer");var s=v(t=k(_,t,"message")),c=t.length;_.push(s);var h=null,o=0;void 0!=a&&(h=v(a=k(_,a,"key")),o=a.length,_.push(h));var p=new l(e|=0),i=p.address;if(_.push(i),0==(0|r._crypto_generichash(i,e,s,c,0,h,o))){var d=y(p,n);return g(_),d}b(_,"invalid usage")}function ce(e,t,a){var n=[];u(a),m(n,e,"state_address"),m(n,t,"hash_length"),("number"!=typeof t||(0|t)!==t||t<0)&&f(n,"hash_length must be an unsigned integer");var _=new l(t|=0),s=_.address;if(n.push(s),0==(0|r._crypto_generichash_final(e,s,t))){var c=(r._free(e),y(_,a));return g(n),c}b(n,"invalid usage")}function he(e,t,a){var n=[];u(a);var _=null,s=0;void 0!=e&&(_=v(e=k(n,e,"key")),s=e.length,n.push(_)),m(n,t,"hash_length"),("number"!=typeof t||(0|t)!==t||t<0)&&f(n,"hash_length must be an unsigned integer");var c=new l(357).address;if(0==(0|r._crypto_generichash_init(c,_,s,t))){var h=c;return g(n),h}b(n,"invalid usage")}function oe(e){var t=[];u(e);var a=new l(0|r._crypto_generichash_keybytes()),n=a.address;t.push(n),r._crypto_generichash_keygen(n);var _=y(a,e);return g(t),_}function pe(e,t,a){var n=[];u(a),m(n,e,"state_address");var _=v(t=k(n,t,"message_chunk")),s=t.length;n.push(_),0!=(0|r._crypto_generichash_update(e,_,s))&&b(n,"invalid usage"),g(n)}function ye(e,t){var a=[];u(t);var n=v(e=k(a,e,"message")),_=e.length;a.push(n);var s=new l(0|r._crypto_hash_bytes()),c=s.address;if(a.push(c),0==(0|r._crypto_hash(c,n,_,0))){var h=y(s,t);return g(a),h}b(a,"invalid usage")}function ie(e,t){var a=[];u(t);var n=v(e=k(a,e,"message")),_=e.length;a.push(n);var s=new l(0|r._crypto_hash_sha256_bytes()),c=s.address;if(a.push(c),0==(0|r._crypto_hash_sha256(c,n,_,0))){var h=y(s,t);return g(a),h}b(a,"invalid usage")}function ue(e,t){var a=[];u(t);var n=v(e=k(a,e,"message")),_=e.length;a.push(n);var s=new l(0|r._crypto_hash_sha512_bytes()),c=s.address;if(a.push(c),0==(0|r._crypto_hash_sha512(c,n,_,0))){var h=y(s,t);return g(a),h}b(a,"invalid usage")}function le(e,t,a,n,s){var c=[];u(s),m(c,e,"subkey_len"),("number"!=typeof e||(0|e)!==e||e<0)&&f(c,"subkey_len must be an unsigned integer"),m(c,t,"subkey_id"),("number"!=typeof t||(0|t)!==t||t<0)&&f(c,"subkey_id must be an unsigned integer");var h=v(a=_(a+"\0"));a.length,c.push(h),n=k(c,n,"key");var o,p=0|r._crypto_kdf_keybytes();n.length!==p&&f(c,"invalid key length"),o=v(n),c.push(o);var i=new l(0|e),d=i.address;c.push(d),r._crypto_kdf_derive_from_key(d,e,t,0,h,o);var b=y(i,s);return g(c),b}function ve(e){var t=[];u(e);var a=new l(0|r._crypto_kdf_keybytes()),n=a.address;t.push(n),r._crypto_kdf_keygen(n);var _=y(a,e);return g(t),_}function de(e,t,a,n){var _=[];u(n),e=k(_,e,"clientPublicKey");var s,c=0|r._crypto_kx_publickeybytes();e.length!==c&&f(_,"invalid clientPublicKey length"),s=v(e),_.push(s),t=k(_,t,"clientSecretKey");var h,o=0|r._crypto_kx_secretkeybytes();t.length!==o&&f(_,"invalid clientSecretKey length"),h=v(t),_.push(h),a=k(_,a,"serverPublicKey");var p,i=0|r._crypto_kx_publickeybytes();a.length!==i&&f(_,"invalid serverPublicKey length"),p=v(a),_.push(p);var d=new l(0|r._crypto_kx_sessionkeybytes()),m=d.address;_.push(m);var x=new l(0|r._crypto_kx_sessionkeybytes()),E=x.address;if(_.push(E),0==(0|r._crypto_kx_client_session_keys(m,E,s,h,p))){var w=y({sharedRx:d,sharedTx:x},n);return g(_),w}b(_,"invalid usage")}function ge(e){var t=[];u(e);var a=new l(0|r._crypto_kx_publickeybytes()),n=a.address;t.push(n);var _=new l(0|r._crypto_kx_secretkeybytes()),s=_.address;if(t.push(s),0==(0|r._crypto_kx_keypair(n,s))){var c={publicKey:y(a,e),privateKey:y(_,e),keyType:"x25519"};return g(t),c}b(t,"internal error")}function be(e,t){var a=[];u(t),e=k(a,e,"seed");var n,_=0|r._crypto_kx_seedbytes();e.length!==_&&f(a,"invalid seed length"),n=v(e),a.push(n);var s=new l(0|r._crypto_kx_publickeybytes()),c=s.address;a.push(c);var h=new l(0|r._crypto_kx_secretkeybytes()),o=h.address;if(a.push(o),0==(0|r._crypto_kx_seed_keypair(c,o,n))){var p={publicKey:y(s,t),privateKey:y(h,t),keyType:"x25519"};return g(a),p}b(a,"internal error")}function fe(e,t,a,n){var _=[];u(n),e=k(_,e,"serverPublicKey");var s,c=0|r._crypto_kx_publickeybytes();e.length!==c&&f(_,"invalid serverPublicKey length"),s=v(e),_.push(s),t=k(_,t,"serverSecretKey");var h,o=0|r._crypto_kx_secretkeybytes();t.length!==o&&f(_,"invalid serverSecretKey length"),h=v(t),_.push(h),a=k(_,a,"clientPublicKey");var p,i=0|r._crypto_kx_publickeybytes();a.length!==i&&f(_,"invalid clientPublicKey length"),p=v(a),_.push(p);var d=new l(0|r._crypto_kx_sessionkeybytes()),m=d.address;_.push(m);var x=new l(0|r._crypto_kx_sessionkeybytes()),E=x.address;if(_.push(E),0==(0|r._crypto_kx_server_session_keys(m,E,s,h,p))){var w=y({sharedRx:d,sharedTx:x},n);return g(_),w}b(_,"invalid usage")}function me(e,t,a){var n=[];u(a);var _=v(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_onetimeauth_keybytes();t.length!==h&&f(n,"invalid key length"),c=v(t),n.push(c);var o=new l(0|r._crypto_onetimeauth_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_onetimeauth(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function ke(e,t){var a=[];u(t),m(a,e,"state_address");var n=new l(0|r._crypto_onetimeauth_bytes()),_=n.address;if(a.push(_),0==(0|r._crypto_onetimeauth_final(e,_))){var s=(r._free(e),y(n,t));return g(a),s}b(a,"invalid usage")}function xe(e,t){var a=[];u(t);var n=null;void 0!=e&&(n=v(e=k(a,e,"key")),e.length,a.push(n));var _=new l(144).address;if(0==(0|r._crypto_onetimeauth_init(_,n))){var s=_;return g(a),s}b(a,"invalid usage")}function Ee(e){var t=[];u(e);var a=new l(0|r._crypto_onetimeauth_keybytes()),n=a.address;t.push(n),r._crypto_onetimeauth_keygen(n);var _=y(a,e);return g(t),_}function we(e,t,a){var n=[];u(a),m(n,e,"state_address");var _=v(t=k(n,t,"message_chunk")),s=t.length;n.push(_),0!=(0|r._crypto_onetimeauth_update(e,_,s))&&b(n,"invalid usage"),g(n)}function Se(e,t,a){var n=[];e=k(n,e,"hash");var _,s=0|r._crypto_onetimeauth_bytes();e.length!==s&&f(n,"invalid hash length"),_=v(e),n.push(_);var c=v(t=k(n,t,"message")),h=t.length;n.push(c),a=k(n,a,"key");var o,p=0|r._crypto_onetimeauth_keybytes();a.length!==p&&f(n,"invalid key length"),o=v(a),n.push(o);var y=0==(0|r._crypto_onetimeauth_verify(_,c,h,0,o));return g(n),y}function Te(e,t,a,n,_,s,c){var h=[];u(c),m(h,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&f(h,"keyLength must be an unsigned integer");var o=v(t=k(h,t,"password")),p=t.length;h.push(o),a=k(h,a,"salt");var i,d=0|r._crypto_pwhash_saltbytes();a.length!==d&&f(h,"invalid salt length"),i=v(a),h.push(i),m(h,n,"opsLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&f(h,"opsLimit must be an unsigned integer"),m(h,_,"memLimit"),("number"!=typeof _||(0|_)!==_||_<0)&&f(h,"memLimit must be an unsigned integer"),m(h,s,"algorithm"),("number"!=typeof s||(0|s)!==s||s<0)&&f(h,"algorithm must be an unsigned integer");var x=new l(0|e),E=x.address;if(h.push(E),0==(0|r._crypto_pwhash(E,e,0,o,p,0,i,n,0,_,s))){var w=y(x,c);return g(h),w}b(h,"invalid usage")}function Ye(e,t,a,n,_,s){var c=[];u(s),m(c,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&f(c,"keyLength must be an unsigned integer");var h=v(t=k(c,t,"password")),o=t.length;c.push(h),a=k(c,a,"salt");var p,i=0|r._crypto_pwhash_scryptsalsa208sha256_saltbytes();a.length!==i&&f(c,"invalid salt length"),p=v(a),c.push(p),m(c,n,"opsLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&f(c,"opsLimit must be an unsigned integer"),m(c,_,"memLimit"),("number"!=typeof _||(0|_)!==_||_<0)&&f(c,"memLimit must be an unsigned integer");var d=new l(0|e),x=d.address;if(c.push(x),0==(0|r._crypto_pwhash_scryptsalsa208sha256(x,e,0,h,o,0,p,n,0,_))){var E=y(d,s);return g(c),E}b(c,"invalid usage")}function Ae(e,t,a,n,_,s,c){var h=[];u(c);var o=v(e=k(h,e,"password")),p=e.length;h.push(o);var i=v(t=k(h,t,"salt")),d=t.length;h.push(i),m(h,a,"opsLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&f(h,"opsLimit must be an unsigned integer"),m(h,n,"r"),("number"!=typeof n||(0|n)!==n||n<0)&&f(h,"r must be an unsigned integer"),m(h,_,"p"),("number"!=typeof _||(0|_)!==_||_<0)&&f(h,"p must be an unsigned integer"),m(h,s,"keyLength"),("number"!=typeof s||(0|s)!==s||s<0)&&f(h,"keyLength must be an unsigned integer");var x=new l(0|s),E=x.address;if(h.push(E),0==(0|r._crypto_pwhash_scryptsalsa208sha256_ll(o,p,i,d,a,0,n,_,E,s))){var w=y(x,c);return g(h),w}b(h,"invalid usage")}function Ke(e,t,a,n){var _=[];u(n);var s=v(e=k(_,e,"password")),c=e.length;_.push(s),m(_,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&f(_,"opsLimit must be an unsigned integer"),m(_,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&f(_,"memLimit must be an unsigned integer");var h=new l(0|r._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(_.push(h),0==(0|r._crypto_pwhash_scryptsalsa208sha256_str(h,s,c,0,t,0,a))){var o=r.Pointer_stringify(h);return g(_),o}b(_,"invalid usage")}function Be(e,t,a){var n=[];u(a);var s=v(e=_(e+"\0"));e.length,n.push(s);var c=v(t=k(n,t,"password")),h=t.length;n.push(c);var o=0==(0|r._crypto_pwhash_scryptsalsa208sha256_str_verify(s,c,h,0));return g(n),o}function Ie(e,t,a,n){var _=[];u(n);var s=v(e=k(_,e,"password")),c=e.length;_.push(s),m(_,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&f(_,"opsLimit must be an unsigned integer"),m(_,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&f(_,"memLimit must be an unsigned integer");var h=new l(0|r._crypto_pwhash_strbytes()).address;if(_.push(h),0==(0|r._crypto_pwhash_str(h,s,c,0,t,0,a))){var o=r.Pointer_stringify(h);return g(_),o}b(_,"invalid usage")}function Me(e,t,a){var n=[];u(a);var s=v(e=_(e+"\0"));e.length,n.push(s);var c=v(t=k(n,t,"password")),h=t.length;n.push(c);var o=0==(0|r._crypto_pwhash_str_verify(s,c,h,0));return g(n),o}function Le(e,t,a){var n=[];u(a),e=k(n,e,"privateKey");var _,s=0|r._crypto_scalarmult_scalarbytes();e.length!==s&&f(n,"invalid privateKey length"),_=v(e),n.push(_),t=k(n,t,"publicKey");var c,h=0|r._crypto_scalarmult_scalarbytes();t.length!==h&&f(n,"invalid publicKey length"),c=v(t),n.push(c);var o=new l(0|r._crypto_scalarmult_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_scalarmult(p,_,c))){var i=y(o,a);return g(n),i}b(n,"weak public key")}function Ne(e,t){var a=[];u(t),e=k(a,e,"privateKey");var n,_=0|r._crypto_scalarmult_scalarbytes();e.length!==_&&f(a,"invalid privateKey length"),n=v(e),a.push(n);var s=new l(0|r._crypto_scalarmult_scalarbytes()),c=s.address;if(a.push(c),0==(0|r._crypto_scalarmult_base(c,n))){var h=y(s,t);return g(a),h}b(a,"insecure scalar")}function Ue(e,t,a,n){var _=[];u(n);var s=v(e=k(_,e,"message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_secretbox_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=v(t),_.push(h),a=k(_,a,"key");var p,i=0|r._crypto_secretbox_keybytes();a.length!==i&&f(_,"invalid key length"),p=v(a),_.push(p);var d=new l(0|c),m=d.address;_.push(m);var x=new l(0|r._crypto_secretbox_macbytes()),E=x.address;if(_.push(E),0==(0|r._crypto_secretbox_detached(m,E,s,c,0,h,p))){var w=y({mac:x,cipher:d},n);return g(_),w}b(_,"invalid usage")}function Oe(e,t,a,n){var _=[];u(n);var s=v(e=k(_,e,"message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_secretbox_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=v(t),_.push(h),a=k(_,a,"key");var p,i=0|r._crypto_secretbox_keybytes();a.length!==i&&f(_,"invalid key length"),p=v(a),_.push(p);var d=new l(c+r._crypto_secretbox_macbytes()|0),m=d.address;if(_.push(m),0==(0|r._crypto_secretbox_easy(m,s,c,0,h,p))){var x=y(d,n);return g(_),x}b(_,"invalid usage")}function Re(e){var t=[];u(e);var a=new l(0|r._crypto_secretbox_keybytes()),n=a.address;t.push(n),r._crypto_secretbox_keygen(n);var _=y(a,e);return g(t),_}function Pe(e,t,a,n,_){var s=[];u(_);var c=v(e=k(s,e,"ciphertext")),h=e.length;s.push(c),t=k(s,t,"mac");var o,p=0|r._crypto_secretbox_macbytes();t.length!==p&&f(s,"invalid mac length"),o=v(t),s.push(o),a=k(s,a,"nonce");var i,d=0|r._crypto_secretbox_noncebytes();a.length!==d&&f(s,"invalid nonce length"),i=v(a),s.push(i),n=k(s,n,"key");var m,x=0|r._crypto_secretbox_keybytes();n.length!==x&&f(s,"invalid key length"),m=v(n),s.push(m);var E=new l(0|h),w=E.address;if(s.push(w),0==(0|r._crypto_secretbox_open_detached(w,c,o,h,0,i,m))){var S=y(E,_);return g(s),S}b(s,"wrong secret key for the given ciphertext")}function Ce(e,t,a,n){var _=[];u(n),e=k(_,e,"ciphertext");var s,c=r._crypto_secretbox_macbytes(),h=e.length;h<c&&f(_,"ciphertext is too short"),s=v(e),_.push(s),t=k(_,t,"nonce");var o,p=0|r._crypto_secretbox_noncebytes();t.length!==p&&f(_,"invalid nonce length"),o=v(t),_.push(o),a=k(_,a,"key");var i,d=0|r._crypto_secretbox_keybytes();a.length!==d&&f(_,"invalid key length"),i=v(a),_.push(i);var m=new l(h-r._crypto_secretbox_macbytes()|0),x=m.address;if(_.push(x),0==(0|r._crypto_secretbox_open_easy(x,s,h,0,o,i))){var E=y(m,n);return g(_),E}b(_,"wrong secret key for the given ciphertext")}function Ge(e,t,a){var n=[];u(a),e=k(n,e,"header");var _,s=0|r._crypto_secretstream_xchacha20poly1305_headerbytes();e.length!==s&&f(n,"invalid header length"),_=v(e),n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_secretstream_xchacha20poly1305_keybytes();t.length!==h&&f(n,"invalid key length"),c=v(t),n.push(c);var o=new l(52).address;if(0==(0|r._crypto_secretstream_xchacha20poly1305_init_pull(o,_,c))){var p=o;return g(n),p}b(n,"invalid usage")}function De(e,t){var a=[];u(t),e=k(a,e,"key");var n,_=0|r._crypto_secretstream_xchacha20poly1305_keybytes();e.length!==_&&f(a,"invalid key length"),n=v(e),a.push(n);var s=new l(52).address,c=new l(0|r._crypto_secretstream_xchacha20poly1305_headerbytes()),h=c.address;if(a.push(h),0==(0|r._crypto_secretstream_xchacha20poly1305_init_push(s,h,n))){var o={state:s,header:y(c,t)};return g(a),o}b(a,"invalid usage")}function Xe(e){var t=[];u(e);var a=new l(0|r._crypto_secretstream_xchacha20poly1305_keybytes()),n=a.address;t.push(n),r._crypto_secretstream_xchacha20poly1305_keygen(n);var _=y(a,e);return g(t),_}function Ve(e,t,a,n){var _=[];u(n),m(_,e,"state_address"),t=k(_,t,"cipher");var s,c=r._crypto_secretstream_xchacha20poly1305_abytes(),h=t.length;h<c&&f(_,"cipher is too short"),s=v(t),_.push(s);var o=null,p=0;void 0!=a&&(o=v(a=k(_,a,"ad")),p=a.length,_.push(o));var i=new l(h-r._crypto_secretstream_xchacha20poly1305_abytes()|0),b=i.address;_.push(b);var x,E=(x=d(1),_.push(x),(E=0===r._crypto_secretstream_xchacha20poly1305_pull(e,b,0,x,s,h,0,o,p)&&{tag:r.HEAPU8[x],message:i})&&{message:y(E.message,n),tag:E.tag});return g(_),E}function Fe(e,t,a,n,_){var s=[];u(_),m(s,e,"state_address");var c=v(t=k(s,t,"message_chunk")),h=t.length;s.push(c);var o=null,p=0;void 0!=a&&(o=v(a=k(s,a,"ad")),p=a.length,s.push(o)),m(s,n,"tag"),("number"!=typeof n||(0|n)!==n||n<0)&&f(s,"tag must be an unsigned integer");var i=new l(h+r._crypto_secretstream_xchacha20poly1305_abytes()|0),d=i.address;if(s.push(d),0==(0|r._crypto_secretstream_xchacha20poly1305_push(e,d,0,c,h,0,o,p,0,n))){var x=y(i,_);return g(s),x}b(s,"invalid usage")}function He(e,t){var a=[];return u(t),m(a,e,"state_address"),r._crypto_secretstream_xchacha20poly1305_rekey(e),g(a),!0}function je(e,t,a){var n=[];u(a);var _=v(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_shorthash_keybytes();t.length!==h&&f(n,"invalid key length"),c=v(t),n.push(c);var o=new l(0|r._crypto_shorthash_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_shorthash(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function ze(e){var t=[];u(e);var a=new l(0|r._crypto_shorthash_keybytes()),n=a.address;t.push(n),r._crypto_shorthash_keygen(n);var _=y(a,e);return g(t),_}function We(e,t,a){var n=[];u(a);var _=v(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_shorthash_siphashx24_keybytes();t.length!==h&&f(n,"invalid key length"),c=v(t),n.push(c);var o=new l(0|r._crypto_shorthash_siphashx24_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_shorthash_siphashx24(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function Je(e,t,a){var n=[];u(a);var _=v(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"privateKey");var c,h=0|r._crypto_sign_secretkeybytes();t.length!==h&&f(n,"invalid privateKey length"),c=v(t),n.push(c);var o=new l(e.length+r._crypto_sign_bytes()|0),p=o.address;if(n.push(p),0==(0|r._crypto_sign(p,null,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function qe(e,t,a){var n=[];u(a);var _=v(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"privateKey");var c,h=0|r._crypto_sign_secretkeybytes();t.length!==h&&f(n,"invalid privateKey length"),c=v(t),n.push(c);var o=new l(0|r._crypto_sign_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_sign_detached(p,null,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function Qe(e,t){var a=[];u(t),e=k(a,e,"edPk");var n,_=0|r._crypto_sign_publickeybytes();e.length!==_&&f(a,"invalid edPk length"),n=v(e),a.push(n);var s=new l(0|r._crypto_scalarmult_scalarbytes()),c=s.address;if(a.push(c),0==(0|r._crypto_sign_ed25519_pk_to_curve25519(c,n))){var h=y(s,t);return g(a),h}b(a,"invalid key")}function Ze(e,t){var a=[];u(t),e=k(a,e,"edSk");var n,_=0|r._crypto_sign_secretkeybytes();e.length!==_&&f(a,"invalid edSk length"),n=v(e),a.push(n);var s=new l(0|r._crypto_scalarmult_scalarbytes()),c=s.address;if(a.push(c),0==(0|r._crypto_sign_ed25519_sk_to_curve25519(c,n))){var h=y(s,t);return g(a),h}b(a,"invalid key")}function $e(e,t){var a=[];u(t),e=k(a,e,"privateKey");var n,_=0|r._crypto_sign_secretkeybytes();e.length!==_&&f(a,"invalid privateKey length"),n=v(e),a.push(n);var s=new l(0|r._crypto_sign_publickeybytes()),c=s.address;if(a.push(c),0==(0|r._crypto_sign_ed25519_sk_to_pk(c,n))){var h=y(s,t);return g(a),h}b(a,"invalid key")}function et(e,t){var a=[];u(t),e=k(a,e,"privateKey");var n,_=0|r._crypto_sign_secretkeybytes();e.length!==_&&f(a,"invalid privateKey length"),n=v(e),a.push(n);var s=new l(0|r._crypto_sign_seedbytes()),c=s.address;if(a.push(c),0==(0|r._crypto_sign_ed25519_sk_to_seed(c,n))){var h=y(s,t);return g(a),h}b(a,"invalid key")}function tt(e,t,a){var n=[];u(a),m(n,e,"state_address"),t=k(n,t,"privateKey");var _,s=0|r._crypto_sign_secretkeybytes();t.length!==s&&f(n,"invalid privateKey length"),_=v(t),n.push(_);var c=new l(0|r._crypto_sign_bytes()),h=c.address;if(n.push(h),0==(0|r._crypto_sign_final_create(e,h,null,_))){var o=(r._free(e),y(c,a));return g(n),o}b(n,"invalid usage")}function rt(e,t,a,n){var _=[];u(n),m(_,e,"state_address"),t=k(_,t,"signature");var s,c=0|r._crypto_sign_bytes();t.length!==c&&f(_,"invalid signature length"),s=v(t),_.push(s),a=k(_,a,"publicKey");var h,o=0|r._crypto_sign_publickeybytes();a.length!==o&&f(_,"invalid publicKey length"),h=v(a),_.push(h);var p=0==(0|r._crypto_sign_final_verify(e,s,h));return g(_),p}function at(e){var t=[];u(e);var a=new l(208).address;if(0==(0|r._crypto_sign_init(a))){var n=a;return g(t),n}b(t,"internal error")}function nt(e){var t=[];u(e);var a=new l(0|r._crypto_sign_publickeybytes()),n=a.address;t.push(n);var _=new l(0|r._crypto_sign_secretkeybytes()),s=_.address;if(t.push(s),0==(0|r._crypto_sign_keypair(n,s))){var c={publicKey:y(a,e),privateKey:y(_,e),keyType:"ed25519"};return g(t),c}b(t,"internal error")}function _t(e,t,a){var n=[];u(a),e=k(n,e,"signedMessage");var _,s=r._crypto_sign_bytes(),c=e.length;c<s&&f(n,"signedMessage is too short"),_=v(e),n.push(_),t=k(n,t,"publicKey");var h,o=0|r._crypto_sign_publickeybytes();t.length!==o&&f(n,"invalid publicKey length"),h=v(t),n.push(h);var p=new l(c-r._crypto_sign_bytes()|0),i=p.address;if(n.push(i),0==(0|r._crypto_sign_open(i,null,_,c,0,h))){var d=y(p,a);return g(n),d}b(n,"incorrect signature for the given public key")}function st(e,t){var a=[];u(t),e=k(a,e,"seed");var n,_=0|r._crypto_sign_seedbytes();e.length!==_&&f(a,"invalid seed length"),n=v(e),a.push(n);var s=new l(0|r._crypto_sign_publickeybytes()),c=s.address;a.push(c);var h=new l(0|r._crypto_sign_secretkeybytes()),o=h.address;if(a.push(o),0==(0|r._crypto_sign_seed_keypair(c,o,n))){var p={publicKey:y(s,t),privateKey:y(h,t),keyType:"ed25519"};return g(a),p}b(a,"invalid usage")}function ct(e,t,a){var n=[];u(a),m(n,e,"state_address");var _=v(t=k(n,t,"message_chunk")),s=t.length;n.push(_),0!=(0|r._crypto_sign_update(e,_,s))&&b(n,"invalid usage"),g(n)}function ht(e,t,a){var n=[];e=k(n,e,"signature");var _,s=0|r._crypto_sign_bytes();e.length!==s&&f(n,"invalid signature length"),_=v(e),n.push(_);var c=v(t=k(n,t,"message")),h=t.length;n.push(c),a=k(n,a,"publicKey");var o,p=0|r._crypto_sign_publickeybytes();a.length!==p&&f(n,"invalid publicKey length"),o=v(a),n.push(o);var y=0==(0|r._crypto_sign_verify_detached(_,c,h,0,o));return g(n),y}function ot(e,t,a,n){var _=[];u(n),m(_,e,"outLength"),("number"!=typeof e||(0|e)!==e||e<0)&&f(_,"outLength must be an unsigned integer"),t=k(_,t,"key");var s,c=0|r._crypto_stream_chacha20_keybytes();t.length!==c&&f(_,"invalid key length"),s=v(t),_.push(s),a=k(_,a,"nonce");var h,o=0|r._crypto_stream_chacha20_noncebytes();a.length!==o&&f(_,"invalid nonce length"),h=v(a),_.push(h);var p=new l(0|e),i=p.address;_.push(i),r._crypto_stream_chacha20(i,e,0,h,s);var d=y(p,n);return g(_),d}function pt(e,t,a,n){var _=[];u(n);var s=v(e=k(_,e,"input_message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_stream_chacha20_ietf_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=v(t),_.push(h),a=k(_,a,"key");var p,i=0|r._crypto_stream_chacha20_ietf_keybytes();a.length!==i&&f(_,"invalid key length"),p=v(a),_.push(p);var d=new l(0|c),m=d.address;if(_.push(m),0===r._crypto_stream_chacha20_ietf_xor(m,s,c,0,h,p)){var x=y(d,n);return g(_),x}b(_,"invalid usage")}function yt(e,t,a,n,_){var s=[];u(_);var c=v(e=k(s,e,"input_message")),h=e.length;s.push(c),t=k(s,t,"nonce");var o,p=0|r._crypto_stream_chacha20_ietf_noncebytes();t.length!==p&&f(s,"invalid nonce length"),o=v(t),s.push(o),m(s,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&f(s,"nonce_increment must be an unsigned integer"),n=k(s,n,"key");var i,d=0|r._crypto_stream_chacha20_ietf_keybytes();n.length!==d&&f(s,"invalid key length"),i=v(n),s.push(i);var x=new l(0|h),E=x.address;if(s.push(E),0===r._crypto_stream_chacha20_ietf_xor_ic(E,c,h,0,o,a,0,i)){var w=y(x,_);return g(s),w}b(s,"invalid usage")}function it(e){var t=[];u(e);var a=new l(0|r._crypto_stream_chacha20_keybytes()),n=a.address;t.push(n),r._crypto_stream_chacha20_keygen(n);var _=y(a,e);return g(t),_}function ut(e,t,a,n){var _=[];u(n);var s=v(e=k(_,e,"input_message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_stream_chacha20_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=v(t),_.push(h),a=k(_,a,"key");var p,i=0|r._crypto_stream_chacha20_keybytes();a.length!==i&&f(_,"invalid key length"),p=v(a),_.push(p);var d=new l(0|c),m=d.address;if(_.push(m),0===r._crypto_stream_chacha20_xor(m,s,c,0,h,p)){var x=y(d,n);return g(_),x}b(_,"invalid usage")}function lt(e,t,a,n,_){var s=[];u(_);var c=v(e=k(s,e,"input_message")),h=e.length;s.push(c),t=k(s,t,"nonce");var o,p=0|r._crypto_stream_chacha20_noncebytes();t.length!==p&&f(s,"invalid nonce length"),o=v(t),s.push(o),m(s,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&f(s,"nonce_increment must be an unsigned integer"),n=k(s,n,"key");var i,d=0|r._crypto_stream_chacha20_keybytes();n.length!==d&&f(s,"invalid key length"),i=v(n),s.push(i);var x=new l(0|h),E=x.address;if(s.push(E),0===r._crypto_stream_chacha20_xor_ic(E,c,h,0,o,a,0,i)){var w=y(x,_);return g(s),w}b(s,"invalid usage")}function vt(e){var t=[];u(e);var a=new l(0|r._crypto_stream_keybytes()),n=a.address;t.push(n),r._crypto_stream_keygen(n);var _=y(a,e);return g(t),_}function dt(e){var t=[];u(e);var a=new l(0|r._crypto_stream_xchacha20_keybytes()),n=a.address;t.push(n),r._crypto_stream_xchacha20_keygen(n);var _=y(a,e);return g(t),_}function gt(e,t,a,n){var _=[];u(n);var s=v(e=k(_,e,"input_message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_stream_xchacha20_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=v(t),_.push(h),a=k(_,a,"key");var p,i=0|r._crypto_stream_xchacha20_keybytes();a.length!==i&&f(_,"invalid key length"),p=v(a),_.push(p);var d=new l(0|c),m=d.address;if(_.push(m),0===r._crypto_stream_xchacha20_xor(m,s,c,0,h,p)){var x=y(d,n);return g(_),x}b(_,"invalid usage")}function bt(e,t,a,n,_){var s=[];u(_);var c=v(e=k(s,e,"input_message")),h=e.length;s.push(c),t=k(s,t,"nonce");var o,p=0|r._crypto_stream_xchacha20_noncebytes();t.length!==p&&f(s,"invalid nonce length"),o=v(t),s.push(o),m(s,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&f(s,"nonce_increment must be an unsigned integer"),n=k(s,n,"key");var i,d=0|r._crypto_stream_xchacha20_keybytes();n.length!==d&&f(s,"invalid key length"),i=v(n),s.push(i);var x=new l(0|h),E=x.address;if(s.push(E),0===r._crypto_stream_xchacha20_xor_ic(E,c,h,0,o,a,0,i)){var w=y(x,_);return g(s),w}b(s,"invalid usage")}function ft(e,t){var a=[];u(t),m(a,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&f(a,"length must be an unsigned integer");var n=new l(0|e),_=n.address;a.push(_),r._randombytes_buf(_,e);var s=y(n,t);return g(a),s}function mt(e,t,a){var n=[];u(a),m(n,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&f(n,"length must be an unsigned integer"),t=k(n,t,"seed");var _,s=0|r._randombytes_seedbytes();t.length!==s&&f(n,"invalid seed length"),_=v(t),n.push(_);var c=new l(0|e),h=c.address;n.push(h),r._randombytes_buf_deterministic(h,e,_);var o=y(c,a);return g(n),o}function kt(e){u(e),r._randombytes_close()}function xt(e){u(e);var t=r._randombytes_random()>>>0;return g([]),t}function Et(e,t){var a=[];u(t);for(var n=r._malloc(24),_=0;_<6;_++)r.setValue(n+4*_,r.Runtime.addFunction(e[["implementation_name","random","stir","uniform","buf","close"][_]]),"i32");0!=(0|r._randombytes_set_implementation(n))&&b(a,"unsupported implementation"),g(a)}function wt(e){u(e),r._randombytes_stir()}function St(e,t){var a=[];u(t),m(a,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&f(a,"upper_bound must be an unsigned integer");var n=r._randombytes_uniform(e)>>>0;return g(a),n}function Tt(){var e=r._sodium_version_string(),t=r.Pointer_stringify(e);return g([]),t}return l.prototype.to_Uint8Array=function(){var e=new Uint8Array(this.length);return e.set(r.HEAPU8.subarray(this.address,this.address+this.length)),e},e.add=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can added");var r=e.length,a=0,n=0;if(t.length!=e.length)throw new TypeError("Arguments must have the same length");for(n=0;n<r;n++)a>>=8,a+=e[n]+t[r],e[n]=255&a},e.base64_variants=h,e.compare=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var r=0,a=1,n=e.length;n-- >0;)r|=t[n]-e[n]>>8&a,a&=(t[n]^e[n])-1>>8;return r+r+a-1},e.from_base64=function(e,t){t=o(t);var a,n=[],_=new l(3*(e=k(n,e,"input")).length/4),s=v(e),c=d(4),h=d(4);return n.push(s),n.push(_.address),n.push(_.result_bin_len_p),n.push(_.b64_end_p),0!==r._sodium_base642bin(_.address,_.length,s,e.length,0,c,h,t)&&b(n,"invalid input"),r.getValue(h,"i32")-s!==e.length&&b(n,"incomplete input"),_.length=r.getValue(c,"i32"),a=_.to_Uint8Array(),g(n),a},e.from_hex=function(e){var t,a=[],n=new l((e=k(a,e,"input")).length/2),_=v(e),s=d(4);return a.push(_),a.push(n.address),a.push(n.hex_end_p),0!==r._sodium_hex2bin(n.address,n.length,_,e.length,0,0,s)&&b(a,"invalid input"),r.getValue(s,"i32")-_!==e.length&&b(a,"incomplete input"),t=n.to_Uint8Array(),g(a),t},e.from_string=_,e.increment=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be incremented");for(var t=256,r=0,a=e.length;r<a;r++)t>>=8,t+=e[r],e[r]=255&t},e.is_zero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var t=0,r=0,a=e.length;r<a;r++)t|=e[r];return 0===t},e.libsodium=t,e.memcmp=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var r=0,a=0,n=e.length;a<n;a++)r|=e[a]^t[a];return 0===r},e.memzero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be wiped");for(var t=0,r=e.length;t<r;t++)e[t]=0},e.output_formats=function(){return["uint8array","text","hex","base64"]},e.pad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var a,n=[],_=d(4),s=1,c=0,h=0|e.length,o=new l(h+t);n.push(_),n.push(o.address);for(var p=o.address,y=o.address+h+t;p<y;p++)r.HEAPU8[p]=e[c],c+=s=1&~((65535&((h-=s)>>>48|h>>>32|h>>>16|h))-1>>16);return 0!==r._sodium_pad(_,o.address,e.length,t,o.length)&&b(n,"internal error"),o.length=r.getValue(_,"i32"),a=o.to_Uint8Array(),g(n),a},e.unpad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var a=[],n=v(e),_=d(4);return a.push(n),a.push(_),0!==r._sodium_unpad(_,n,e.length,t)&&b(a,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,r.getValue(_,"i32")),g(a),e},e.ready=n,e.symbols=function(){return Object.keys(e).sort()},e.to_base64=p,e.to_hex=c,e.to_string=s,e}var r="object"==typeof e.sodium&&"function"==typeof e.sodium.onload?e.sodium.onload:null;"function"==typeof define&&define.amd?define(["exports","libsodium-sumo"],t):"object"==typeof exports&&"string"!=typeof exports.nodeName?t(exports,require("libsodium-sumo")):e.sodium=t(e.commonJsStrict={},e.libsodium),r&&e.sodium.ready.then(function(){r(e.sodium)})}(this); | ||
!function(e){function t(e,t){"use strict";var r,a="uint8array",n=t.ready.then(function(){function a(){if(0!==r._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var t=["crypto_aead_chacha20poly1305_decrypt","crypto_aead_chacha20poly1305_decrypt_detached","crypto_aead_chacha20poly1305_encrypt","crypto_aead_chacha20poly1305_encrypt_detached","crypto_aead_chacha20poly1305_ietf_decrypt","crypto_aead_chacha20poly1305_ietf_decrypt_detached","crypto_aead_chacha20poly1305_ietf_encrypt","crypto_aead_chacha20poly1305_ietf_encrypt_detached","crypto_aead_chacha20poly1305_ietf_keygen","crypto_aead_chacha20poly1305_keygen","crypto_aead_xchacha20poly1305_ietf_decrypt","crypto_aead_xchacha20poly1305_ietf_decrypt_detached","crypto_aead_xchacha20poly1305_ietf_encrypt","crypto_aead_xchacha20poly1305_ietf_encrypt_detached","crypto_aead_xchacha20poly1305_ietf_keygen","crypto_auth","crypto_auth_hmacsha256","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_generichash","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha512","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],a=[x,E,w,S,T,Y,A,K,B,I,M,L,N,U,O,R,P,C,G,D,X,V,F,H,j,z,W,J,q,Q,Z,$,ee,te,re,ae,ne,_e,se,ce,he,oe,pe,ye,ie,ue,le,de,ve,ge,be,fe,me,ke,xe,Ee,we,Se,Te,Ye,Ae,Ke,Be,Ie,Me,Le,Ne,Ue,Oe,Re,Pe,Ce,Ge,De,Xe,Ve,Fe,He,je,ze,We,Je,qe,Qe,Ze,$e,et,tt,rt,at,nt,_t,st,ct,ht,ot,pt,yt,it,ut,lt,dt,vt,gt,bt,ft,mt,kt,xt,Et,wt,St,Tt],n=0;n<a.length;n++)"function"==typeof r["_"+t[n]]&&(e[t[n]]=a[n]);var _=["SODIUM_LIBRARY_VERSION_MAJOR","SODIUM_LIBRARY_VERSION_MINOR","crypto_aead_chacha20poly1305_ABYTES","crypto_aead_chacha20poly1305_KEYBYTES","crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX","crypto_aead_chacha20poly1305_NPUBBYTES","crypto_aead_chacha20poly1305_NSECBYTES","crypto_aead_chacha20poly1305_ietf_ABYTES","crypto_aead_chacha20poly1305_ietf_KEYBYTES","crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX","crypto_aead_chacha20poly1305_ietf_NPUBBYTES","crypto_aead_chacha20poly1305_ietf_NSECBYTES","crypto_aead_xchacha20poly1305_ietf_ABYTES","crypto_aead_xchacha20poly1305_ietf_KEYBYTES","crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX","crypto_aead_xchacha20poly1305_ietf_NPUBBYTES","crypto_aead_xchacha20poly1305_ietf_NSECBYTES","crypto_auth_BYTES","crypto_auth_KEYBYTES","crypto_auth_hmacsha256_BYTES","crypto_auth_hmacsha256_KEYBYTES","crypto_auth_hmacsha512_BYTES","crypto_auth_hmacsha512_KEYBYTES","crypto_box_BEFORENMBYTES","crypto_box_MACBYTES","crypto_box_MESSAGEBYTES_MAX","crypto_box_NONCEBYTES","crypto_box_PUBLICKEYBYTES","crypto_box_SEALBYTES","crypto_box_SECRETKEYBYTES","crypto_box_SEEDBYTES","crypto_box_curve25519xchacha20poly1305_NONCEBYTES","crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES","crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES","crypto_core_hchacha20_CONSTBYTES","crypto_core_hchacha20_INPUTBYTES","crypto_core_hchacha20_KEYBYTES","crypto_core_hchacha20_OUTPUTBYTES","crypto_generichash_BYTES","crypto_generichash_BYTES_MAX","crypto_generichash_BYTES_MIN","crypto_generichash_KEYBYTES","crypto_generichash_KEYBYTES_MAX","crypto_generichash_KEYBYTES_MIN","crypto_hash_BYTES","crypto_hash_sha256_BYTES","crypto_hash_sha512_BYTES","crypto_kdf_BYTES_MAX","crypto_kdf_BYTES_MIN","crypto_kdf_CONTEXTBYTES","crypto_kdf_KEYBYTES","crypto_kx_PUBLICKEYBYTES","crypto_kx_SECRETKEYBYTES","crypto_kx_SEEDBYTES","crypto_kx_SESSIONKEYBYTES","crypto_onetimeauth_BYTES","crypto_onetimeauth_KEYBYTES","crypto_pwhash_ALG_ARGON2I13","crypto_pwhash_ALG_ARGON2ID13","crypto_pwhash_ALG_DEFAULT","crypto_pwhash_BYTES_MAX","crypto_pwhash_BYTES_MIN","crypto_pwhash_MEMLIMIT_INTERACTIVE","crypto_pwhash_MEMLIMIT_MAX","crypto_pwhash_MEMLIMIT_MIN","crypto_pwhash_MEMLIMIT_MODERATE","crypto_pwhash_MEMLIMIT_SENSITIVE","crypto_pwhash_OPSLIMIT_INTERACTIVE","crypto_pwhash_OPSLIMIT_MAX","crypto_pwhash_OPSLIMIT_MIN","crypto_pwhash_OPSLIMIT_MODERATE","crypto_pwhash_OPSLIMIT_SENSITIVE","crypto_pwhash_PASSWD_MAX","crypto_pwhash_PASSWD_MIN","crypto_pwhash_SALTBYTES","crypto_pwhash_STRBYTES","crypto_pwhash_STR_VERIFY","crypto_pwhash_scryptsalsa208sha256_BYTES_MAX","crypto_pwhash_scryptsalsa208sha256_BYTES_MIN","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN","crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN","crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE","crypto_pwhash_scryptsalsa208sha256_SALTBYTES","crypto_pwhash_scryptsalsa208sha256_STRBYTES","crypto_pwhash_scryptsalsa208sha256_STR_VERIFY","crypto_scalarmult_BYTES","crypto_scalarmult_SCALARBYTES","crypto_secretbox_KEYBYTES","crypto_secretbox_MACBYTES","crypto_secretbox_MESSAGEBYTES_MAX","crypto_secretbox_NONCEBYTES","crypto_secretstream_xchacha20poly1305_ABYTES","crypto_secretstream_xchacha20poly1305_HEADERBYTES","crypto_secretstream_xchacha20poly1305_KEYBYTES","crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretstream_xchacha20poly1305_MESSAGESBYTES_MAX","crypto_secretstream_xchacha20poly1305_NPUBBYTES","crypto_secretstream_xchacha20poly1305_TAG_FINAL","crypto_secretstream_xchacha20poly1305_TAG_MESSAGE","crypto_secretstream_xchacha20poly1305_TAG_PUSH","crypto_secretstream_xchacha20poly1305_TAG_REKEY","crypto_shorthash_BYTES","crypto_shorthash_KEYBYTES","crypto_shorthash_siphashx24_BYTES","crypto_shorthash_siphashx24_KEYBYTES","crypto_sign_BYTES","crypto_sign_MESSAGEBYTES_MAX","crypto_sign_PUBLICKEYBYTES","crypto_sign_SECRETKEYBYTES","crypto_sign_SEEDBYTES","crypto_stream_KEYBYTES","crypto_stream_MESSAGEBYTES_MAX","crypto_stream_NONCEBYTES","crypto_stream_chacha20_KEYBYTES","crypto_stream_chacha20_NONCEBYTES","crypto_stream_chacha20_ietf_KEYBYTES","crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX","crypto_stream_chacha20_ietf_NONCEBYTES","crypto_stream_xchacha20_KEYBYTES","crypto_stream_xchacha20_MESSAGEBYTES_MAX","crypto_stream_xchacha20_NONCEBYTES","randombytes_SEEDBYTES"];for(n=0;n<_.length;n++)"function"==typeof(c=r["_"+_[n].toLowerCase()])&&(e[_[n]]=c());var s=["SODIUM_VERSION_STRING","crypto_pwhash_STRPREFIX","crypto_pwhash_scryptsalsa208sha256_STRPREFIX"];for(n=0;n<s.length;n++){var c;"function"==typeof(c=r["_"+s[n].toLowerCase()])&&(e[s[n]]=r.UTF8ToString(c()))}}r=t;try{a();var n=new Uint8Array([98,97,108,108,115]),_=e.randombytes_buf(e.crypto_secretbox_NONCEBYTES),s=e.randombytes_buf(e.crypto_secretbox_KEYBYTES),c=e.crypto_secretbox_easy(n,_,s),h=e.crypto_secretbox_open_easy(c,_,s);if(e.memcmp(n,h))return}catch(e){if(null==r.useBackupModule)throw new Error("Both wasm and asm failed to load"+e)}r.useBackupModule(),a()});function _(e){if("function"==typeof TextEncoder)return(new TextEncoder).encode(e);e=unescape(encodeURIComponent(e));for(var t=new Uint8Array(e.length),r=0,a=e.length;r<a;r++)t[r]=e.charCodeAt(r);return t}function s(e){if("function"==typeof TextDecoder)return new TextDecoder("utf-8",{fatal:!0}).decode(e);var t=Math.ceil(e.length/8192);if(t<=1)try{return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}catch(e){throw new TypeError("The encoded data was not valid.")}for(var r="",a=0,n=0;n<t;n++){var _=Array.prototype.slice.call(e,8192*n+a,8192*(n+1)+a);if(0!=_.length){var c,h=_.length,o=0;do{var p=_[--h];p>=240?(o=4,c=!0):p>=224?(o=3,c=!0):p>=192?(o=2,c=!0):p<128&&(o=1,c=!0)}while(!c);for(var y=o-(_.length-h),i=0;i<y;i++)a--,_.pop();r+=s(_)}}return r}function c(e){e=k(null,e,"input");for(var t,r,a,n="",_=0;_<e.length;_++)a=87+(r=15&e[_])+(r-10>>8&-39)<<8|87+(t=e[_]>>>4)+(t-10>>8&-39),n+=String.fromCharCode(255&a)+String.fromCharCode(a>>>8);return n}var h={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function o(e){if(null==e)return h.URLSAFE_NO_PADDING;if(e!==h.ORIGINAL&&e!==h.ORIGINAL_NO_PADDING&&e!==h.URLSAFE&&e!=h.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function p(e,t){t=o(t),e=k(n,e,"input");var a,n=[],_=0|Math.floor(e.length/3),c=e.length-3*_,h=4*_+(0!==c?0==(2&t)?4:2+(c>>>1):0),p=new l(h+1),y=d(e);return n.push(y),n.push(p.address),0===r._sodium_bin2base64(p.address,p.length,y,e.length,t)&&b(n,"conversion failed"),p.length=h,a=s(p.to_Uint8Array()),g(n),a}function y(e,t){var r=t||a;if(!i(r))throw new Error(r+" output format is not available");if(e instanceof l){if("uint8array"===r)return e.to_Uint8Array();if("text"===r)return s(e.to_Uint8Array());if("hex"===r)return c(e.to_Uint8Array());if("base64"===r)return p(e.to_Uint8Array(),h.URLSAFE_NO_PADDING);throw new Error('What is output format "'+r+'"?')}if("object"==typeof e){for(var n=Object.keys(e),_={},o=0;o<n.length;o++)_[n[o]]=y(e[n[o]],r);return _}if("string"==typeof e)return e;throw new TypeError("Cannot format output")}function i(e){for(var t=["uint8array","text","hex","base64"],r=0;r<t.length;r++)if(t[r]===e)return!0;return!1}function u(e){if(e){if("string"!=typeof e)throw new TypeError("When defined, the output format must be a string");if(!i(e))throw new Error(e+" is not a supported output format")}}function l(e){this.length=e,this.address=v(e)}function d(e){var t=v(e.length);return r.HEAPU8.set(e,t),t}function v(e){var t=r._malloc(e);if(0===t)throw{message:"_malloc() failed",length:e};return t}function g(e){if(e)for(var t=0;t<e.length;t++)a=e[t],r._free(a);var a}function b(e,t){throw g(e),new Error(t)}function f(e,t){throw g(e),new TypeError(t)}function m(e,t,r){null==t&&f(e,r+" cannot be null or undefined")}function k(e,t,r){return m(e,t,r),t instanceof Uint8Array?t:"string"==typeof t?_(t):void f(e,"unsupported input type for "+r)}function x(e,t,a,n,_,s){var c=[];u(s);var h=null;null!=e&&(h=d(e=k(c,e,"secret_nonce")),e.length,c.push(h)),t=k(c,t,"ciphertext");var o,p=r._crypto_aead_chacha20poly1305_abytes(),i=t.length;i<p&&f(c,"ciphertext is too short"),o=d(t),c.push(o);var v=null,m=0;null!=a&&(v=d(a=k(c,a,"additional_data")),m=a.length,c.push(v)),n=k(c,n,"public_nonce");var x,E=0|r._crypto_aead_chacha20poly1305_npubbytes();n.length!==E&&f(c,"invalid public_nonce length"),x=d(n),c.push(x),_=k(c,_,"key");var w,S=0|r._crypto_aead_chacha20poly1305_keybytes();_.length!==S&&f(c,"invalid key length"),w=d(_),c.push(w);var T=new l(i-r._crypto_aead_chacha20poly1305_abytes()|0),Y=T.address;if(c.push(Y),0===r._crypto_aead_chacha20poly1305_decrypt(Y,null,h,o,i,0,v,m,0,x,w)){var A=y(T,s);return g(c),A}b(c,"ciphertext cannot be decrypted using that key")}function E(e,t,a,n,_,s,c){var h=[];u(c);var o=null;null!=e&&(o=d(e=k(h,e,"secret_nonce")),e.length,h.push(o));var p=d(t=k(h,t,"ciphertext")),i=t.length;h.push(p),a=k(h,a,"mac");var v,m=0|r._crypto_box_macbytes();a.length!==m&&f(h,"invalid mac length"),v=d(a),h.push(v);var x=null,E=0;null!=n&&(x=d(n=k(h,n,"additional_data")),E=n.length,h.push(x)),_=k(h,_,"public_nonce");var w,S=0|r._crypto_aead_chacha20poly1305_npubbytes();_.length!==S&&f(h,"invalid public_nonce length"),w=d(_),h.push(w),s=k(h,s,"key");var T,Y=0|r._crypto_aead_chacha20poly1305_keybytes();s.length!==Y&&f(h,"invalid key length"),T=d(s),h.push(T);var A=new l(0|i),K=A.address;if(h.push(K),0===r._crypto_aead_chacha20poly1305_decrypt_detached(K,o,p,i,0,v,x,E,0,w,T)){var B=y(A,c);return g(h),B}b(h,"ciphertext cannot be decrypted using that key")}function w(e,t,a,n,_,s){var c=[];u(s);var h=d(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;null!=t&&(p=d(t=k(c,t,"additional_data")),i=t.length,c.push(p));var v=null;null!=a&&(v=d(a=k(c,a,"secret_nonce")),a.length,c.push(v)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=d(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_chacha20poly1305_keybytes();_.length!==w&&f(c,"invalid key length"),E=d(_),c.push(E);var S=new l(o+r._crypto_aead_chacha20poly1305_abytes()|0),T=S.address;if(c.push(T),0===r._crypto_aead_chacha20poly1305_encrypt(T,null,h,o,0,p,i,0,v,m,E)){var Y=y(S,s);return g(c),Y}b(c,"invalid usage")}function S(e,t,a,n,_,s){var c=[];u(s);var h=d(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;null!=t&&(p=d(t=k(c,t,"additional_data")),i=t.length,c.push(p));var v=null;null!=a&&(v=d(a=k(c,a,"secret_nonce")),a.length,c.push(v)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=d(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_chacha20poly1305_keybytes();_.length!==w&&f(c,"invalid key length"),E=d(_),c.push(E);var S=new l(0|o),T=S.address;c.push(T);var Y=new l(0|r._crypto_aead_chacha20poly1305_abytes()),A=Y.address;if(c.push(A),0===r._crypto_aead_chacha20poly1305_encrypt_detached(T,A,null,h,o,0,p,i,0,v,m,E)){var K=y({ciphertext:S,mac:Y},s);return g(c),K}b(c,"invalid usage")}function T(e,t,a,n,_,s){var c=[];u(s);var h=null;null!=e&&(h=d(e=k(c,e,"secret_nonce")),e.length,c.push(h)),t=k(c,t,"ciphertext");var o,p=r._crypto_aead_chacha20poly1305_ietf_abytes(),i=t.length;i<p&&f(c,"ciphertext is too short"),o=d(t),c.push(o);var v=null,m=0;null!=a&&(v=d(a=k(c,a,"additional_data")),m=a.length,c.push(v)),n=k(c,n,"public_nonce");var x,E=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();n.length!==E&&f(c,"invalid public_nonce length"),x=d(n),c.push(x),_=k(c,_,"key");var w,S=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();_.length!==S&&f(c,"invalid key length"),w=d(_),c.push(w);var T=new l(i-r._crypto_aead_chacha20poly1305_ietf_abytes()|0),Y=T.address;if(c.push(Y),0===r._crypto_aead_chacha20poly1305_ietf_decrypt(Y,null,h,o,i,0,v,m,0,x,w)){var A=y(T,s);return g(c),A}b(c,"ciphertext cannot be decrypted using that key")}function Y(e,t,a,n,_,s,c){var h=[];u(c);var o=null;null!=e&&(o=d(e=k(h,e,"secret_nonce")),e.length,h.push(o));var p=d(t=k(h,t,"ciphertext")),i=t.length;h.push(p),a=k(h,a,"mac");var v,m=0|r._crypto_box_macbytes();a.length!==m&&f(h,"invalid mac length"),v=d(a),h.push(v);var x=null,E=0;null!=n&&(x=d(n=k(h,n,"additional_data")),E=n.length,h.push(x)),_=k(h,_,"public_nonce");var w,S=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==S&&f(h,"invalid public_nonce length"),w=d(_),h.push(w),s=k(h,s,"key");var T,Y=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==Y&&f(h,"invalid key length"),T=d(s),h.push(T);var A=new l(0|i),K=A.address;if(h.push(K),0===r._crypto_aead_chacha20poly1305_ietf_decrypt_detached(K,o,p,i,0,v,x,E,0,w,T)){var B=y(A,c);return g(h),B}b(h,"ciphertext cannot be decrypted using that key")}function A(e,t,a,n,_,s){var c=[];u(s);var h=d(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;null!=t&&(p=d(t=k(c,t,"additional_data")),i=t.length,c.push(p));var v=null;null!=a&&(v=d(a=k(c,a,"secret_nonce")),a.length,c.push(v)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=d(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();_.length!==w&&f(c,"invalid key length"),E=d(_),c.push(E);var S=new l(o+r._crypto_aead_chacha20poly1305_ietf_abytes()|0),T=S.address;if(c.push(T),0===r._crypto_aead_chacha20poly1305_ietf_encrypt(T,null,h,o,0,p,i,0,v,m,E)){var Y=y(S,s);return g(c),Y}b(c,"invalid usage")}function K(e,t,a,n,_,s){var c=[];u(s);var h=d(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;null!=t&&(p=d(t=k(c,t,"additional_data")),i=t.length,c.push(p));var v=null;null!=a&&(v=d(a=k(c,a,"secret_nonce")),a.length,c.push(v)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=d(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();_.length!==w&&f(c,"invalid key length"),E=d(_),c.push(E);var S=new l(0|o),T=S.address;c.push(T);var Y=new l(0|r._crypto_aead_chacha20poly1305_ietf_abytes()),A=Y.address;if(c.push(A),0===r._crypto_aead_chacha20poly1305_ietf_encrypt_detached(T,A,null,h,o,0,p,i,0,v,m,E)){var K=y({ciphertext:S,mac:Y},s);return g(c),K}b(c,"invalid usage")}function B(e){var t=[];u(e);var a=new l(0|r._crypto_aead_chacha20poly1305_ietf_keybytes()),n=a.address;t.push(n),r._crypto_aead_chacha20poly1305_ietf_keygen(n);var _=y(a,e);return g(t),_}function I(e){var t=[];u(e);var a=new l(0|r._crypto_aead_chacha20poly1305_keybytes()),n=a.address;t.push(n),r._crypto_aead_chacha20poly1305_keygen(n);var _=y(a,e);return g(t),_}function M(e,t,a,n,_,s){var c=[];u(s);var h=null;null!=e&&(h=d(e=k(c,e,"secret_nonce")),e.length,c.push(h)),t=k(c,t,"ciphertext");var o,p=r._crypto_aead_xchacha20poly1305_ietf_abytes(),i=t.length;i<p&&f(c,"ciphertext is too short"),o=d(t),c.push(o);var v=null,m=0;null!=a&&(v=d(a=k(c,a,"additional_data")),m=a.length,c.push(v)),n=k(c,n,"public_nonce");var x,E=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();n.length!==E&&f(c,"invalid public_nonce length"),x=d(n),c.push(x),_=k(c,_,"key");var w,S=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();_.length!==S&&f(c,"invalid key length"),w=d(_),c.push(w);var T=new l(i-r._crypto_aead_xchacha20poly1305_ietf_abytes()|0),Y=T.address;if(c.push(Y),0===r._crypto_aead_xchacha20poly1305_ietf_decrypt(Y,null,h,o,i,0,v,m,0,x,w)){var A=y(T,s);return g(c),A}b(c,"ciphertext cannot be decrypted using that key")}function L(e,t,a,n,_,s,c){var h=[];u(c);var o=null;null!=e&&(o=d(e=k(h,e,"secret_nonce")),e.length,h.push(o));var p=d(t=k(h,t,"ciphertext")),i=t.length;h.push(p),a=k(h,a,"mac");var v,m=0|r._crypto_box_macbytes();a.length!==m&&f(h,"invalid mac length"),v=d(a),h.push(v);var x=null,E=0;null!=n&&(x=d(n=k(h,n,"additional_data")),E=n.length,h.push(x)),_=k(h,_,"public_nonce");var w,S=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==S&&f(h,"invalid public_nonce length"),w=d(_),h.push(w),s=k(h,s,"key");var T,Y=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==Y&&f(h,"invalid key length"),T=d(s),h.push(T);var A=new l(0|i),K=A.address;if(h.push(K),0===r._crypto_aead_xchacha20poly1305_ietf_decrypt_detached(K,o,p,i,0,v,x,E,0,w,T)){var B=y(A,c);return g(h),B}b(h,"ciphertext cannot be decrypted using that key")}function N(e,t,a,n,_,s){var c=[];u(s);var h=d(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;null!=t&&(p=d(t=k(c,t,"additional_data")),i=t.length,c.push(p));var v=null;null!=a&&(v=d(a=k(c,a,"secret_nonce")),a.length,c.push(v)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=d(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();_.length!==w&&f(c,"invalid key length"),E=d(_),c.push(E);var S=new l(o+r._crypto_aead_xchacha20poly1305_ietf_abytes()|0),T=S.address;if(c.push(T),0===r._crypto_aead_xchacha20poly1305_ietf_encrypt(T,null,h,o,0,p,i,0,v,m,E)){var Y=y(S,s);return g(c),Y}b(c,"invalid usage")}function U(e,t,a,n,_,s){var c=[];u(s);var h=d(e=k(c,e,"message")),o=e.length;c.push(h);var p=null,i=0;null!=t&&(p=d(t=k(c,t,"additional_data")),i=t.length,c.push(p));var v=null;null!=a&&(v=d(a=k(c,a,"secret_nonce")),a.length,c.push(v)),n=k(c,n,"public_nonce");var m,x=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();n.length!==x&&f(c,"invalid public_nonce length"),m=d(n),c.push(m),_=k(c,_,"key");var E,w=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();_.length!==w&&f(c,"invalid key length"),E=d(_),c.push(E);var S=new l(0|o),T=S.address;c.push(T);var Y=new l(0|r._crypto_aead_xchacha20poly1305_ietf_abytes()),A=Y.address;if(c.push(A),0===r._crypto_aead_xchacha20poly1305_ietf_encrypt_detached(T,A,null,h,o,0,p,i,0,v,m,E)){var K=y({ciphertext:S,mac:Y},s);return g(c),K}b(c,"invalid usage")}function O(e){var t=[];u(e);var a=new l(0|r._crypto_aead_xchacha20poly1305_ietf_keybytes()),n=a.address;t.push(n),r._crypto_aead_xchacha20poly1305_ietf_keygen(n);var _=y(a,e);return g(t),_}function R(e,t,a){var n=[];u(a);var _=d(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_auth_keybytes();t.length!==h&&f(n,"invalid key length"),c=d(t),n.push(c);var o=new l(0|r._crypto_auth_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_auth(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function P(e,t,a){var n=[];u(a);var _=d(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_auth_hmacsha256_keybytes();t.length!==h&&f(n,"invalid key length"),c=d(t),n.push(c);var o=new l(0|r._crypto_auth_hmacsha256_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_auth_hmacsha256(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function C(e){var t=[];u(e);var a=new l(0|r._crypto_auth_hmacsha256_keybytes()),n=a.address;t.push(n),r._crypto_auth_hmacsha256_keygen(n);var _=y(a,e);return g(t),_}function G(e,t,a){var n=[];e=k(n,e,"tag");var _,s=0|r._crypto_auth_hmacsha256_bytes();e.length!==s&&f(n,"invalid tag length"),_=d(e),n.push(_);var c=d(t=k(n,t,"message")),h=t.length;n.push(c),a=k(n,a,"key");var o,p=0|r._crypto_auth_hmacsha256_keybytes();a.length!==p&&f(n,"invalid key length"),o=d(a),n.push(o);var y=0==(0|r._crypto_auth_hmacsha256_verify(_,c,h,0,o));return g(n),y}function D(e,t,a){var n=[];u(a);var _=d(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_auth_hmacsha512_keybytes();t.length!==h&&f(n,"invalid key length"),c=d(t),n.push(c);var o=new l(0|r._crypto_auth_hmacsha512_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_auth_hmacsha512(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function X(e){var t=[];u(e);var a=new l(0|r._crypto_auth_hmacsha512_keybytes()),n=a.address;t.push(n),r._crypto_auth_hmacsha512_keygen(n);var _=y(a,e);return g(t),_}function V(e,t,a){var n=[];e=k(n,e,"tag");var _,s=0|r._crypto_auth_hmacsha512_bytes();e.length!==s&&f(n,"invalid tag length"),_=d(e),n.push(_);var c=d(t=k(n,t,"message")),h=t.length;n.push(c),a=k(n,a,"key");var o,p=0|r._crypto_auth_hmacsha512_keybytes();a.length!==p&&f(n,"invalid key length"),o=d(a),n.push(o);var y=0==(0|r._crypto_auth_hmacsha512_verify(_,c,h,0,o));return g(n),y}function F(e){var t=[];u(e);var a=new l(0|r._crypto_auth_keybytes()),n=a.address;t.push(n),r._crypto_auth_keygen(n);var _=y(a,e);return g(t),_}function H(e,t,a){var n=[];e=k(n,e,"tag");var _,s=0|r._crypto_auth_bytes();e.length!==s&&f(n,"invalid tag length"),_=d(e),n.push(_);var c=d(t=k(n,t,"message")),h=t.length;n.push(c),a=k(n,a,"key");var o,p=0|r._crypto_auth_keybytes();a.length!==p&&f(n,"invalid key length"),o=d(a),n.push(o);var y=0==(0|r._crypto_auth_verify(_,c,h,0,o));return g(n),y}function j(e,t,a){var n=[];u(a),e=k(n,e,"publicKey");var _,s=0|r._crypto_box_publickeybytes();e.length!==s&&f(n,"invalid publicKey length"),_=d(e),n.push(_),t=k(n,t,"privateKey");var c,h=0|r._crypto_box_secretkeybytes();t.length!==h&&f(n,"invalid privateKey length"),c=d(t),n.push(c);var o=new l(0|r._crypto_box_beforenmbytes()),p=o.address;if(n.push(p),0==(0|r._crypto_box_beforenm(p,_,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function z(e){var t=[];u(e);var a=new l(0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes()),n=a.address;t.push(n);var _=new l(0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes()),s=_.address;t.push(s),r._crypto_box_curve25519xchacha20poly1305_keypair(n,s);var c=y({publicKey:a,privateKey:_,keyType:"curve25519"},e);return g(t),c}function W(e,t,a){var n=[];u(a);var _=d(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"publicKey");var c,h=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==h&&f(n,"invalid publicKey length"),c=d(t),n.push(c);var o=new l(s+r._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),p=o.address;n.push(p),r._crypto_box_curve25519xchacha20poly1305_seal(p,_,s,0,c);var i=y(o,a);return g(n),i}function J(e,t,a,n){var _=[];u(n),e=k(_,e,"ciphertext");var s,c=r._crypto_box_curve25519xchacha20poly1305_sealbytes(),h=e.length;h<c&&f(_,"ciphertext is too short"),s=d(e),_.push(s),t=k(_,t,"publicKey");var o,p=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==p&&f(_,"invalid publicKey length"),o=d(t),_.push(o),a=k(_,a,"secretKey");var i,v=0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes();a.length!==v&&f(_,"invalid secretKey length"),i=d(a),_.push(i);var b=new l(h-r._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),m=b.address;_.push(m),r._crypto_box_curve25519xchacha20poly1305_seal_open(m,s,h,0,o,i);var x=y(b,n);return g(_),x}function q(e,t,a,n,_){var s=[];u(_);var c=d(e=k(s,e,"message")),h=e.length;s.push(c),t=k(s,t,"nonce");var o,p=0|r._crypto_box_noncebytes();t.length!==p&&f(s,"invalid nonce length"),o=d(t),s.push(o),a=k(s,a,"publicKey");var i,v=0|r._crypto_box_publickeybytes();a.length!==v&&f(s,"invalid publicKey length"),i=d(a),s.push(i),n=k(s,n,"privateKey");var m,x=0|r._crypto_box_secretkeybytes();n.length!==x&&f(s,"invalid privateKey length"),m=d(n),s.push(m);var E=new l(0|h),w=E.address;s.push(w);var S=new l(0|r._crypto_box_macbytes()),T=S.address;if(s.push(T),0==(0|r._crypto_box_detached(w,T,c,h,0,o,i,m))){var Y=y({ciphertext:E,mac:S},_);return g(s),Y}b(s,"invalid usage")}function Q(e,t,a,n,_){var s=[];u(_);var c=d(e=k(s,e,"message")),h=e.length;s.push(c),t=k(s,t,"nonce");var o,p=0|r._crypto_box_noncebytes();t.length!==p&&f(s,"invalid nonce length"),o=d(t),s.push(o),a=k(s,a,"publicKey");var i,v=0|r._crypto_box_publickeybytes();a.length!==v&&f(s,"invalid publicKey length"),i=d(a),s.push(i),n=k(s,n,"privateKey");var m,x=0|r._crypto_box_secretkeybytes();n.length!==x&&f(s,"invalid privateKey length"),m=d(n),s.push(m);var E=new l(h+r._crypto_box_macbytes()|0),w=E.address;if(s.push(w),0==(0|r._crypto_box_easy(w,c,h,0,o,i,m))){var S=y(E,_);return g(s),S}b(s,"invalid usage")}function Z(e,t,a,n){var _=[];u(n);var s=d(e=k(_,e,"message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_box_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=d(t),_.push(h),a=k(_,a,"sharedKey");var p,i=0|r._crypto_box_beforenmbytes();a.length!==i&&f(_,"invalid sharedKey length"),p=d(a),_.push(p);var v=new l(c+r._crypto_box_macbytes()|0),m=v.address;if(_.push(m),0==(0|r._crypto_box_easy_afternm(m,s,c,0,h,p))){var x=y(v,n);return g(_),x}b(_,"invalid usage")}function $(e){var t=[];u(e);var a=new l(0|r._crypto_box_publickeybytes()),n=a.address;t.push(n);var _=new l(0|r._crypto_box_secretkeybytes()),s=_.address;if(t.push(s),0==(0|r._crypto_box_keypair(n,s))){var c={publicKey:y(a,e),privateKey:y(_,e),keyType:"x25519"};return g(t),c}b(t,"internal error")}function ee(e,t,a,n,_,s){var c=[];u(s);var h=d(e=k(c,e,"ciphertext")),o=e.length;c.push(h),t=k(c,t,"mac");var p,i=0|r._crypto_box_macbytes();t.length!==i&&f(c,"invalid mac length"),p=d(t),c.push(p),a=k(c,a,"nonce");var v,m=0|r._crypto_box_noncebytes();a.length!==m&&f(c,"invalid nonce length"),v=d(a),c.push(v),n=k(c,n,"publicKey");var x,E=0|r._crypto_box_publickeybytes();n.length!==E&&f(c,"invalid publicKey length"),x=d(n),c.push(x),_=k(c,_,"privateKey");var w,S=0|r._crypto_box_secretkeybytes();_.length!==S&&f(c,"invalid privateKey length"),w=d(_),c.push(w);var T=new l(0|o),Y=T.address;if(c.push(Y),0==(0|r._crypto_box_open_detached(Y,h,p,o,0,v,x,w))){var A=y(T,s);return g(c),A}b(c,"incorrect key pair for the given ciphertext")}function te(e,t,a,n,_){var s=[];u(_),e=k(s,e,"ciphertext");var c,h=r._crypto_box_macbytes(),o=e.length;o<h&&f(s,"ciphertext is too short"),c=d(e),s.push(c),t=k(s,t,"nonce");var p,i=0|r._crypto_box_noncebytes();t.length!==i&&f(s,"invalid nonce length"),p=d(t),s.push(p),a=k(s,a,"publicKey");var v,m=0|r._crypto_box_publickeybytes();a.length!==m&&f(s,"invalid publicKey length"),v=d(a),s.push(v),n=k(s,n,"privateKey");var x,E=0|r._crypto_box_secretkeybytes();n.length!==E&&f(s,"invalid privateKey length"),x=d(n),s.push(x);var w=new l(o-r._crypto_box_macbytes()|0),S=w.address;if(s.push(S),0==(0|r._crypto_box_open_easy(S,c,o,0,p,v,x))){var T=y(w,_);return g(s),T}b(s,"incorrect key pair for the given ciphertext")}function re(e,t,a,n){var _=[];u(n);var s=d(e=k(_,e,"ciphertext")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_box_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=d(t),_.push(h),a=k(_,a,"sharedKey");var p,i=0|r._crypto_box_beforenmbytes();a.length!==i&&f(_,"invalid sharedKey length"),p=d(a),_.push(p);var v=new l(c-r._crypto_box_macbytes()|0),m=v.address;if(_.push(m),0==(0|r._crypto_box_open_easy_afternm(m,s,c,0,h,p))){var x=y(v,n);return g(_),x}b(_,"incorrect secret key for the given ciphertext")}function ae(e,t,a){var n=[];u(a);var _=d(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"publicKey");var c,h=0|r._crypto_box_publickeybytes();t.length!==h&&f(n,"invalid publicKey length"),c=d(t),n.push(c);var o=new l(s+r._crypto_box_sealbytes()|0),p=o.address;if(n.push(p),0==(0|r._crypto_box_seal(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function ne(e,t,a,n){var _=[];u(n),e=k(_,e,"ciphertext");var s,c=r._crypto_box_sealbytes(),h=e.length;h<c&&f(_,"ciphertext is too short"),s=d(e),_.push(s),t=k(_,t,"publicKey");var o,p=0|r._crypto_box_publickeybytes();t.length!==p&&f(_,"invalid publicKey length"),o=d(t),_.push(o),a=k(_,a,"privateKey");var i,v=0|r._crypto_box_secretkeybytes();a.length!==v&&f(_,"invalid privateKey length"),i=d(a),_.push(i);var m=new l(h-r._crypto_box_sealbytes()|0),x=m.address;if(_.push(x),0==(0|r._crypto_box_seal_open(x,s,h,0,o,i))){var E=y(m,n);return g(_),E}b(_,"incorrect key pair for the given ciphertext")}function _e(e,t){var a=[];u(t),e=k(a,e,"seed");var n,_=0|r._crypto_box_seedbytes();e.length!==_&&f(a,"invalid seed length"),n=d(e),a.push(n);var s=new l(0|r._crypto_box_publickeybytes()),c=s.address;a.push(c);var h=new l(0|r._crypto_box_secretkeybytes()),o=h.address;if(a.push(o),0==(0|r._crypto_box_seed_keypair(c,o,n))){var p={publicKey:y(s,t),privateKey:y(h,t),keyType:"x25519"};return g(a),p}b(a,"invalid usage")}function se(e,t,a,n){var _=[];u(n),m(_,e,"hash_length"),("number"!=typeof e||(0|e)!==e||e<0)&&f(_,"hash_length must be an unsigned integer");var s=d(t=k(_,t,"message")),c=t.length;_.push(s);var h=null,o=0;null!=a&&(h=d(a=k(_,a,"key")),o=a.length,_.push(h));var p=new l(e|=0),i=p.address;if(_.push(i),0==(0|r._crypto_generichash(i,e,s,c,0,h,o))){var v=y(p,n);return g(_),v}b(_,"invalid usage")}function ce(e,t,a){var n=[];u(a),m(n,e,"state_address"),m(n,t,"hash_length"),("number"!=typeof t||(0|t)!==t||t<0)&&f(n,"hash_length must be an unsigned integer");var _=new l(t|=0),s=_.address;if(n.push(s),0==(0|r._crypto_generichash_final(e,s,t))){var c=(r._free(e),y(_,a));return g(n),c}b(n,"invalid usage")}function he(e,t,a){var n=[];u(a);var _=null,s=0;null!=e&&(_=d(e=k(n,e,"key")),s=e.length,n.push(_)),m(n,t,"hash_length"),("number"!=typeof t||(0|t)!==t||t<0)&&f(n,"hash_length must be an unsigned integer");var c=new l(357).address;if(0==(0|r._crypto_generichash_init(c,_,s,t))){var h=c;return g(n),h}b(n,"invalid usage")}function oe(e){var t=[];u(e);var a=new l(0|r._crypto_generichash_keybytes()),n=a.address;t.push(n),r._crypto_generichash_keygen(n);var _=y(a,e);return g(t),_}function pe(e,t,a){var n=[];u(a),m(n,e,"state_address");var _=d(t=k(n,t,"message_chunk")),s=t.length;n.push(_),0!=(0|r._crypto_generichash_update(e,_,s))&&b(n,"invalid usage"),g(n)}function ye(e,t){var a=[];u(t);var n=d(e=k(a,e,"message")),_=e.length;a.push(n);var s=new l(0|r._crypto_hash_bytes()),c=s.address;if(a.push(c),0==(0|r._crypto_hash(c,n,_,0))){var h=y(s,t);return g(a),h}b(a,"invalid usage")}function ie(e,t){var a=[];u(t);var n=d(e=k(a,e,"message")),_=e.length;a.push(n);var s=new l(0|r._crypto_hash_sha256_bytes()),c=s.address;if(a.push(c),0==(0|r._crypto_hash_sha256(c,n,_,0))){var h=y(s,t);return g(a),h}b(a,"invalid usage")}function ue(e,t){var a=[];u(t);var n=d(e=k(a,e,"message")),_=e.length;a.push(n);var s=new l(0|r._crypto_hash_sha512_bytes()),c=s.address;if(a.push(c),0==(0|r._crypto_hash_sha512(c,n,_,0))){var h=y(s,t);return g(a),h}b(a,"invalid usage")}function le(e,t,a,n,s){var c=[];u(s),m(c,e,"subkey_len"),("number"!=typeof e||(0|e)!==e||e<0)&&f(c,"subkey_len must be an unsigned integer"),m(c,t,"subkey_id"),("number"!=typeof t||(0|t)!==t||t<0)&&f(c,"subkey_id must be an unsigned integer");var h=d(a=_(a+"\0"));a.length,c.push(h),n=k(c,n,"key");var o,p=0|r._crypto_kdf_keybytes();n.length!==p&&f(c,"invalid key length"),o=d(n),c.push(o);var i=new l(0|e),v=i.address;c.push(v),r._crypto_kdf_derive_from_key(v,e,t,0,h,o);var b=y(i,s);return g(c),b}function de(e){var t=[];u(e);var a=new l(0|r._crypto_kdf_keybytes()),n=a.address;t.push(n),r._crypto_kdf_keygen(n);var _=y(a,e);return g(t),_}function ve(e,t,a,n){var _=[];u(n),e=k(_,e,"clientPublicKey");var s,c=0|r._crypto_kx_publickeybytes();e.length!==c&&f(_,"invalid clientPublicKey length"),s=d(e),_.push(s),t=k(_,t,"clientSecretKey");var h,o=0|r._crypto_kx_secretkeybytes();t.length!==o&&f(_,"invalid clientSecretKey length"),h=d(t),_.push(h),a=k(_,a,"serverPublicKey");var p,i=0|r._crypto_kx_publickeybytes();a.length!==i&&f(_,"invalid serverPublicKey length"),p=d(a),_.push(p);var v=new l(0|r._crypto_kx_sessionkeybytes()),m=v.address;_.push(m);var x=new l(0|r._crypto_kx_sessionkeybytes()),E=x.address;if(_.push(E),0==(0|r._crypto_kx_client_session_keys(m,E,s,h,p))){var w=y({sharedRx:v,sharedTx:x},n);return g(_),w}b(_,"invalid usage")}function ge(e){var t=[];u(e);var a=new l(0|r._crypto_kx_publickeybytes()),n=a.address;t.push(n);var _=new l(0|r._crypto_kx_secretkeybytes()),s=_.address;if(t.push(s),0==(0|r._crypto_kx_keypair(n,s))){var c={publicKey:y(a,e),privateKey:y(_,e),keyType:"x25519"};return g(t),c}b(t,"internal error")}function be(e,t){var a=[];u(t),e=k(a,e,"seed");var n,_=0|r._crypto_kx_seedbytes();e.length!==_&&f(a,"invalid seed length"),n=d(e),a.push(n);var s=new l(0|r._crypto_kx_publickeybytes()),c=s.address;a.push(c);var h=new l(0|r._crypto_kx_secretkeybytes()),o=h.address;if(a.push(o),0==(0|r._crypto_kx_seed_keypair(c,o,n))){var p={publicKey:y(s,t),privateKey:y(h,t),keyType:"x25519"};return g(a),p}b(a,"internal error")}function fe(e,t,a,n){var _=[];u(n),e=k(_,e,"serverPublicKey");var s,c=0|r._crypto_kx_publickeybytes();e.length!==c&&f(_,"invalid serverPublicKey length"),s=d(e),_.push(s),t=k(_,t,"serverSecretKey");var h,o=0|r._crypto_kx_secretkeybytes();t.length!==o&&f(_,"invalid serverSecretKey length"),h=d(t),_.push(h),a=k(_,a,"clientPublicKey");var p,i=0|r._crypto_kx_publickeybytes();a.length!==i&&f(_,"invalid clientPublicKey length"),p=d(a),_.push(p);var v=new l(0|r._crypto_kx_sessionkeybytes()),m=v.address;_.push(m);var x=new l(0|r._crypto_kx_sessionkeybytes()),E=x.address;if(_.push(E),0==(0|r._crypto_kx_server_session_keys(m,E,s,h,p))){var w=y({sharedRx:v,sharedTx:x},n);return g(_),w}b(_,"invalid usage")}function me(e,t,a){var n=[];u(a);var _=d(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_onetimeauth_keybytes();t.length!==h&&f(n,"invalid key length"),c=d(t),n.push(c);var o=new l(0|r._crypto_onetimeauth_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_onetimeauth(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function ke(e,t){var a=[];u(t),m(a,e,"state_address");var n=new l(0|r._crypto_onetimeauth_bytes()),_=n.address;if(a.push(_),0==(0|r._crypto_onetimeauth_final(e,_))){var s=(r._free(e),y(n,t));return g(a),s}b(a,"invalid usage")}function xe(e,t){var a=[];u(t);var n=null;null!=e&&(n=d(e=k(a,e,"key")),e.length,a.push(n));var _=new l(144).address;if(0==(0|r._crypto_onetimeauth_init(_,n))){var s=_;return g(a),s}b(a,"invalid usage")}function Ee(e){var t=[];u(e);var a=new l(0|r._crypto_onetimeauth_keybytes()),n=a.address;t.push(n),r._crypto_onetimeauth_keygen(n);var _=y(a,e);return g(t),_}function we(e,t,a){var n=[];u(a),m(n,e,"state_address");var _=d(t=k(n,t,"message_chunk")),s=t.length;n.push(_),0!=(0|r._crypto_onetimeauth_update(e,_,s))&&b(n,"invalid usage"),g(n)}function Se(e,t,a){var n=[];e=k(n,e,"hash");var _,s=0|r._crypto_onetimeauth_bytes();e.length!==s&&f(n,"invalid hash length"),_=d(e),n.push(_);var c=d(t=k(n,t,"message")),h=t.length;n.push(c),a=k(n,a,"key");var o,p=0|r._crypto_onetimeauth_keybytes();a.length!==p&&f(n,"invalid key length"),o=d(a),n.push(o);var y=0==(0|r._crypto_onetimeauth_verify(_,c,h,0,o));return g(n),y}function Te(e,t,a,n,_,s,c){var h=[];u(c),m(h,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&f(h,"keyLength must be an unsigned integer");var o=d(t=k(h,t,"password")),p=t.length;h.push(o),a=k(h,a,"salt");var i,v=0|r._crypto_pwhash_saltbytes();a.length!==v&&f(h,"invalid salt length"),i=d(a),h.push(i),m(h,n,"opsLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&f(h,"opsLimit must be an unsigned integer"),m(h,_,"memLimit"),("number"!=typeof _||(0|_)!==_||_<0)&&f(h,"memLimit must be an unsigned integer"),m(h,s,"algorithm"),("number"!=typeof s||(0|s)!==s||s<0)&&f(h,"algorithm must be an unsigned integer");var x=new l(0|e),E=x.address;if(h.push(E),0==(0|r._crypto_pwhash(E,e,0,o,p,0,i,n,0,_,s))){var w=y(x,c);return g(h),w}b(h,"invalid usage")}function Ye(e,t,a,n,_,s){var c=[];u(s),m(c,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&f(c,"keyLength must be an unsigned integer");var h=d(t=k(c,t,"password")),o=t.length;c.push(h),a=k(c,a,"salt");var p,i=0|r._crypto_pwhash_scryptsalsa208sha256_saltbytes();a.length!==i&&f(c,"invalid salt length"),p=d(a),c.push(p),m(c,n,"opsLimit"),("number"!=typeof n||(0|n)!==n||n<0)&&f(c,"opsLimit must be an unsigned integer"),m(c,_,"memLimit"),("number"!=typeof _||(0|_)!==_||_<0)&&f(c,"memLimit must be an unsigned integer");var v=new l(0|e),x=v.address;if(c.push(x),0==(0|r._crypto_pwhash_scryptsalsa208sha256(x,e,0,h,o,0,p,n,0,_))){var E=y(v,s);return g(c),E}b(c,"invalid usage")}function Ae(e,t,a,n,_,s,c){var h=[];u(c);var o=d(e=k(h,e,"password")),p=e.length;h.push(o);var i=d(t=k(h,t,"salt")),v=t.length;h.push(i),m(h,a,"opsLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&f(h,"opsLimit must be an unsigned integer"),m(h,n,"r"),("number"!=typeof n||(0|n)!==n||n<0)&&f(h,"r must be an unsigned integer"),m(h,_,"p"),("number"!=typeof _||(0|_)!==_||_<0)&&f(h,"p must be an unsigned integer"),m(h,s,"keyLength"),("number"!=typeof s||(0|s)!==s||s<0)&&f(h,"keyLength must be an unsigned integer");var x=new l(0|s),E=x.address;if(h.push(E),0==(0|r._crypto_pwhash_scryptsalsa208sha256_ll(o,p,i,v,a,0,n,_,E,s))){var w=y(x,c);return g(h),w}b(h,"invalid usage")}function Ke(e,t,a,n){var _=[];u(n);var s=d(e=k(_,e,"password")),c=e.length;_.push(s),m(_,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&f(_,"opsLimit must be an unsigned integer"),m(_,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&f(_,"memLimit must be an unsigned integer");var h=new l(0|r._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(_.push(h),0==(0|r._crypto_pwhash_scryptsalsa208sha256_str(h,s,c,0,t,0,a))){var o=r.UTF8ToString(h);return g(_),o}b(_,"invalid usage")}function Be(e,t,a){var n=[];u(a);var s=d(e=_(e+"\0"));e.length,n.push(s);var c=d(t=k(n,t,"password")),h=t.length;n.push(c);var o=0==(0|r._crypto_pwhash_scryptsalsa208sha256_str_verify(s,c,h,0));return g(n),o}function Ie(e,t,a,n){var _=[];u(n);var s=d(e=k(_,e,"password")),c=e.length;_.push(s),m(_,t,"opsLimit"),("number"!=typeof t||(0|t)!==t||t<0)&&f(_,"opsLimit must be an unsigned integer"),m(_,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&f(_,"memLimit must be an unsigned integer");var h=new l(0|r._crypto_pwhash_strbytes()).address;if(_.push(h),0==(0|r._crypto_pwhash_str(h,s,c,0,t,0,a))){var o=r.UTF8ToString(h);return g(_),o}b(_,"invalid usage")}function Me(e,t,a){var n=[];u(a);var s=d(e=_(e+"\0"));e.length,n.push(s);var c=d(t=k(n,t,"password")),h=t.length;n.push(c);var o=0==(0|r._crypto_pwhash_str_verify(s,c,h,0));return g(n),o}function Le(e,t,a){var n=[];u(a),e=k(n,e,"privateKey");var _,s=0|r._crypto_scalarmult_scalarbytes();e.length!==s&&f(n,"invalid privateKey length"),_=d(e),n.push(_),t=k(n,t,"publicKey");var c,h=0|r._crypto_scalarmult_scalarbytes();t.length!==h&&f(n,"invalid publicKey length"),c=d(t),n.push(c);var o=new l(0|r._crypto_scalarmult_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_scalarmult(p,_,c))){var i=y(o,a);return g(n),i}b(n,"weak public key")}function Ne(e,t){var a=[];u(t),e=k(a,e,"privateKey");var n,_=0|r._crypto_scalarmult_scalarbytes();e.length!==_&&f(a,"invalid privateKey length"),n=d(e),a.push(n);var s=new l(0|r._crypto_scalarmult_scalarbytes()),c=s.address;if(a.push(c),0==(0|r._crypto_scalarmult_base(c,n))){var h=y(s,t);return g(a),h}b(a,"insecure scalar")}function Ue(e,t,a,n){var _=[];u(n);var s=d(e=k(_,e,"message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_secretbox_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=d(t),_.push(h),a=k(_,a,"key");var p,i=0|r._crypto_secretbox_keybytes();a.length!==i&&f(_,"invalid key length"),p=d(a),_.push(p);var v=new l(0|c),m=v.address;_.push(m);var x=new l(0|r._crypto_secretbox_macbytes()),E=x.address;if(_.push(E),0==(0|r._crypto_secretbox_detached(m,E,s,c,0,h,p))){var w=y({mac:x,cipher:v},n);return g(_),w}b(_,"invalid usage")}function Oe(e,t,a,n){var _=[];u(n);var s=d(e=k(_,e,"message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_secretbox_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=d(t),_.push(h),a=k(_,a,"key");var p,i=0|r._crypto_secretbox_keybytes();a.length!==i&&f(_,"invalid key length"),p=d(a),_.push(p);var v=new l(c+r._crypto_secretbox_macbytes()|0),m=v.address;if(_.push(m),0==(0|r._crypto_secretbox_easy(m,s,c,0,h,p))){var x=y(v,n);return g(_),x}b(_,"invalid usage")}function Re(e){var t=[];u(e);var a=new l(0|r._crypto_secretbox_keybytes()),n=a.address;t.push(n),r._crypto_secretbox_keygen(n);var _=y(a,e);return g(t),_}function Pe(e,t,a,n,_){var s=[];u(_);var c=d(e=k(s,e,"ciphertext")),h=e.length;s.push(c),t=k(s,t,"mac");var o,p=0|r._crypto_secretbox_macbytes();t.length!==p&&f(s,"invalid mac length"),o=d(t),s.push(o),a=k(s,a,"nonce");var i,v=0|r._crypto_secretbox_noncebytes();a.length!==v&&f(s,"invalid nonce length"),i=d(a),s.push(i),n=k(s,n,"key");var m,x=0|r._crypto_secretbox_keybytes();n.length!==x&&f(s,"invalid key length"),m=d(n),s.push(m);var E=new l(0|h),w=E.address;if(s.push(w),0==(0|r._crypto_secretbox_open_detached(w,c,o,h,0,i,m))){var S=y(E,_);return g(s),S}b(s,"wrong secret key for the given ciphertext")}function Ce(e,t,a,n){var _=[];u(n),e=k(_,e,"ciphertext");var s,c=r._crypto_secretbox_macbytes(),h=e.length;h<c&&f(_,"ciphertext is too short"),s=d(e),_.push(s),t=k(_,t,"nonce");var o,p=0|r._crypto_secretbox_noncebytes();t.length!==p&&f(_,"invalid nonce length"),o=d(t),_.push(o),a=k(_,a,"key");var i,v=0|r._crypto_secretbox_keybytes();a.length!==v&&f(_,"invalid key length"),i=d(a),_.push(i);var m=new l(h-r._crypto_secretbox_macbytes()|0),x=m.address;if(_.push(x),0==(0|r._crypto_secretbox_open_easy(x,s,h,0,o,i))){var E=y(m,n);return g(_),E}b(_,"wrong secret key for the given ciphertext")}function Ge(e,t,a){var n=[];u(a),e=k(n,e,"header");var _,s=0|r._crypto_secretstream_xchacha20poly1305_headerbytes();e.length!==s&&f(n,"invalid header length"),_=d(e),n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_secretstream_xchacha20poly1305_keybytes();t.length!==h&&f(n,"invalid key length"),c=d(t),n.push(c);var o=new l(52).address;if(0==(0|r._crypto_secretstream_xchacha20poly1305_init_pull(o,_,c))){var p=o;return g(n),p}b(n,"invalid usage")}function De(e,t){var a=[];u(t),e=k(a,e,"key");var n,_=0|r._crypto_secretstream_xchacha20poly1305_keybytes();e.length!==_&&f(a,"invalid key length"),n=d(e),a.push(n);var s=new l(52).address,c=new l(0|r._crypto_secretstream_xchacha20poly1305_headerbytes()),h=c.address;if(a.push(h),0==(0|r._crypto_secretstream_xchacha20poly1305_init_push(s,h,n))){var o={state:s,header:y(c,t)};return g(a),o}b(a,"invalid usage")}function Xe(e){var t=[];u(e);var a=new l(0|r._crypto_secretstream_xchacha20poly1305_keybytes()),n=a.address;t.push(n),r._crypto_secretstream_xchacha20poly1305_keygen(n);var _=y(a,e);return g(t),_}function Ve(e,t,a,n){var _=[];u(n),m(_,e,"state_address"),t=k(_,t,"cipher");var s,c=r._crypto_secretstream_xchacha20poly1305_abytes(),h=t.length;h<c&&f(_,"cipher is too short"),s=d(t),_.push(s);var o=null,p=0;null!=a&&(o=d(a=k(_,a,"ad")),p=a.length,_.push(o));var i=new l(h-r._crypto_secretstream_xchacha20poly1305_abytes()|0),b=i.address;_.push(b);var x,E=(x=v(1),_.push(x),(E=0===r._crypto_secretstream_xchacha20poly1305_pull(e,b,0,x,s,h,0,o,p)&&{tag:r.HEAPU8[x],message:i})&&{message:y(E.message,n),tag:E.tag});return g(_),E}function Fe(e,t,a,n,_){var s=[];u(_),m(s,e,"state_address");var c=d(t=k(s,t,"message_chunk")),h=t.length;s.push(c);var o=null,p=0;null!=a&&(o=d(a=k(s,a,"ad")),p=a.length,s.push(o)),m(s,n,"tag"),("number"!=typeof n||(0|n)!==n||n<0)&&f(s,"tag must be an unsigned integer");var i=new l(h+r._crypto_secretstream_xchacha20poly1305_abytes()|0),v=i.address;if(s.push(v),0==(0|r._crypto_secretstream_xchacha20poly1305_push(e,v,0,c,h,0,o,p,0,n))){var x=y(i,_);return g(s),x}b(s,"invalid usage")}function He(e,t){var a=[];return u(t),m(a,e,"state_address"),r._crypto_secretstream_xchacha20poly1305_rekey(e),g(a),!0}function je(e,t,a){var n=[];u(a);var _=d(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_shorthash_keybytes();t.length!==h&&f(n,"invalid key length"),c=d(t),n.push(c);var o=new l(0|r._crypto_shorthash_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_shorthash(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function ze(e){var t=[];u(e);var a=new l(0|r._crypto_shorthash_keybytes()),n=a.address;t.push(n),r._crypto_shorthash_keygen(n);var _=y(a,e);return g(t),_}function We(e,t,a){var n=[];u(a);var _=d(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"key");var c,h=0|r._crypto_shorthash_siphashx24_keybytes();t.length!==h&&f(n,"invalid key length"),c=d(t),n.push(c);var o=new l(0|r._crypto_shorthash_siphashx24_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_shorthash_siphashx24(p,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function Je(e,t,a){var n=[];u(a);var _=d(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"privateKey");var c,h=0|r._crypto_sign_secretkeybytes();t.length!==h&&f(n,"invalid privateKey length"),c=d(t),n.push(c);var o=new l(e.length+r._crypto_sign_bytes()|0),p=o.address;if(n.push(p),0==(0|r._crypto_sign(p,null,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function qe(e,t,a){var n=[];u(a);var _=d(e=k(n,e,"message")),s=e.length;n.push(_),t=k(n,t,"privateKey");var c,h=0|r._crypto_sign_secretkeybytes();t.length!==h&&f(n,"invalid privateKey length"),c=d(t),n.push(c);var o=new l(0|r._crypto_sign_bytes()),p=o.address;if(n.push(p),0==(0|r._crypto_sign_detached(p,null,_,s,0,c))){var i=y(o,a);return g(n),i}b(n,"invalid usage")}function Qe(e,t){var a=[];u(t),e=k(a,e,"edPk");var n,_=0|r._crypto_sign_publickeybytes();e.length!==_&&f(a,"invalid edPk length"),n=d(e),a.push(n);var s=new l(0|r._crypto_scalarmult_scalarbytes()),c=s.address;if(a.push(c),0==(0|r._crypto_sign_ed25519_pk_to_curve25519(c,n))){var h=y(s,t);return g(a),h}b(a,"invalid key")}function Ze(e,t){var a=[];u(t),e=k(a,e,"edSk");var n,_=0|r._crypto_sign_secretkeybytes();e.length!==_&&f(a,"invalid edSk length"),n=d(e),a.push(n);var s=new l(0|r._crypto_scalarmult_scalarbytes()),c=s.address;if(a.push(c),0==(0|r._crypto_sign_ed25519_sk_to_curve25519(c,n))){var h=y(s,t);return g(a),h}b(a,"invalid key")}function $e(e,t){var a=[];u(t),e=k(a,e,"privateKey");var n,_=0|r._crypto_sign_secretkeybytes();e.length!==_&&f(a,"invalid privateKey length"),n=d(e),a.push(n);var s=new l(0|r._crypto_sign_publickeybytes()),c=s.address;if(a.push(c),0==(0|r._crypto_sign_ed25519_sk_to_pk(c,n))){var h=y(s,t);return g(a),h}b(a,"invalid key")}function et(e,t){var a=[];u(t),e=k(a,e,"privateKey");var n,_=0|r._crypto_sign_secretkeybytes();e.length!==_&&f(a,"invalid privateKey length"),n=d(e),a.push(n);var s=new l(0|r._crypto_sign_seedbytes()),c=s.address;if(a.push(c),0==(0|r._crypto_sign_ed25519_sk_to_seed(c,n))){var h=y(s,t);return g(a),h}b(a,"invalid key")}function tt(e,t,a){var n=[];u(a),m(n,e,"state_address"),t=k(n,t,"privateKey");var _,s=0|r._crypto_sign_secretkeybytes();t.length!==s&&f(n,"invalid privateKey length"),_=d(t),n.push(_);var c=new l(0|r._crypto_sign_bytes()),h=c.address;if(n.push(h),0==(0|r._crypto_sign_final_create(e,h,null,_))){var o=(r._free(e),y(c,a));return g(n),o}b(n,"invalid usage")}function rt(e,t,a,n){var _=[];u(n),m(_,e,"state_address"),t=k(_,t,"signature");var s,c=0|r._crypto_sign_bytes();t.length!==c&&f(_,"invalid signature length"),s=d(t),_.push(s),a=k(_,a,"publicKey");var h,o=0|r._crypto_sign_publickeybytes();a.length!==o&&f(_,"invalid publicKey length"),h=d(a),_.push(h);var p=0==(0|r._crypto_sign_final_verify(e,s,h));return g(_),p}function at(e){var t=[];u(e);var a=new l(208).address;if(0==(0|r._crypto_sign_init(a))){var n=a;return g(t),n}b(t,"internal error")}function nt(e){var t=[];u(e);var a=new l(0|r._crypto_sign_publickeybytes()),n=a.address;t.push(n);var _=new l(0|r._crypto_sign_secretkeybytes()),s=_.address;if(t.push(s),0==(0|r._crypto_sign_keypair(n,s))){var c={publicKey:y(a,e),privateKey:y(_,e),keyType:"ed25519"};return g(t),c}b(t,"internal error")}function _t(e,t,a){var n=[];u(a),e=k(n,e,"signedMessage");var _,s=r._crypto_sign_bytes(),c=e.length;c<s&&f(n,"signedMessage is too short"),_=d(e),n.push(_),t=k(n,t,"publicKey");var h,o=0|r._crypto_sign_publickeybytes();t.length!==o&&f(n,"invalid publicKey length"),h=d(t),n.push(h);var p=new l(c-r._crypto_sign_bytes()|0),i=p.address;if(n.push(i),0==(0|r._crypto_sign_open(i,null,_,c,0,h))){var v=y(p,a);return g(n),v}b(n,"incorrect signature for the given public key")}function st(e,t){var a=[];u(t),e=k(a,e,"seed");var n,_=0|r._crypto_sign_seedbytes();e.length!==_&&f(a,"invalid seed length"),n=d(e),a.push(n);var s=new l(0|r._crypto_sign_publickeybytes()),c=s.address;a.push(c);var h=new l(0|r._crypto_sign_secretkeybytes()),o=h.address;if(a.push(o),0==(0|r._crypto_sign_seed_keypair(c,o,n))){var p={publicKey:y(s,t),privateKey:y(h,t),keyType:"ed25519"};return g(a),p}b(a,"invalid usage")}function ct(e,t,a){var n=[];u(a),m(n,e,"state_address");var _=d(t=k(n,t,"message_chunk")),s=t.length;n.push(_),0!=(0|r._crypto_sign_update(e,_,s))&&b(n,"invalid usage"),g(n)}function ht(e,t,a){var n=[];e=k(n,e,"signature");var _,s=0|r._crypto_sign_bytes();e.length!==s&&f(n,"invalid signature length"),_=d(e),n.push(_);var c=d(t=k(n,t,"message")),h=t.length;n.push(c),a=k(n,a,"publicKey");var o,p=0|r._crypto_sign_publickeybytes();a.length!==p&&f(n,"invalid publicKey length"),o=d(a),n.push(o);var y=0==(0|r._crypto_sign_verify_detached(_,c,h,0,o));return g(n),y}function ot(e,t,a,n){var _=[];u(n),m(_,e,"outLength"),("number"!=typeof e||(0|e)!==e||e<0)&&f(_,"outLength must be an unsigned integer"),t=k(_,t,"key");var s,c=0|r._crypto_stream_chacha20_keybytes();t.length!==c&&f(_,"invalid key length"),s=d(t),_.push(s),a=k(_,a,"nonce");var h,o=0|r._crypto_stream_chacha20_noncebytes();a.length!==o&&f(_,"invalid nonce length"),h=d(a),_.push(h);var p=new l(0|e),i=p.address;_.push(i),r._crypto_stream_chacha20(i,e,0,h,s);var v=y(p,n);return g(_),v}function pt(e,t,a,n){var _=[];u(n);var s=d(e=k(_,e,"input_message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_stream_chacha20_ietf_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=d(t),_.push(h),a=k(_,a,"key");var p,i=0|r._crypto_stream_chacha20_ietf_keybytes();a.length!==i&&f(_,"invalid key length"),p=d(a),_.push(p);var v=new l(0|c),m=v.address;if(_.push(m),0===r._crypto_stream_chacha20_ietf_xor(m,s,c,0,h,p)){var x=y(v,n);return g(_),x}b(_,"invalid usage")}function yt(e,t,a,n,_){var s=[];u(_);var c=d(e=k(s,e,"input_message")),h=e.length;s.push(c),t=k(s,t,"nonce");var o,p=0|r._crypto_stream_chacha20_ietf_noncebytes();t.length!==p&&f(s,"invalid nonce length"),o=d(t),s.push(o),m(s,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&f(s,"nonce_increment must be an unsigned integer"),n=k(s,n,"key");var i,v=0|r._crypto_stream_chacha20_ietf_keybytes();n.length!==v&&f(s,"invalid key length"),i=d(n),s.push(i);var x=new l(0|h),E=x.address;if(s.push(E),0===r._crypto_stream_chacha20_ietf_xor_ic(E,c,h,0,o,a,0,i)){var w=y(x,_);return g(s),w}b(s,"invalid usage")}function it(e){var t=[];u(e);var a=new l(0|r._crypto_stream_chacha20_keybytes()),n=a.address;t.push(n),r._crypto_stream_chacha20_keygen(n);var _=y(a,e);return g(t),_}function ut(e,t,a,n){var _=[];u(n);var s=d(e=k(_,e,"input_message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_stream_chacha20_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=d(t),_.push(h),a=k(_,a,"key");var p,i=0|r._crypto_stream_chacha20_keybytes();a.length!==i&&f(_,"invalid key length"),p=d(a),_.push(p);var v=new l(0|c),m=v.address;if(_.push(m),0===r._crypto_stream_chacha20_xor(m,s,c,0,h,p)){var x=y(v,n);return g(_),x}b(_,"invalid usage")}function lt(e,t,a,n,_){var s=[];u(_);var c=d(e=k(s,e,"input_message")),h=e.length;s.push(c),t=k(s,t,"nonce");var o,p=0|r._crypto_stream_chacha20_noncebytes();t.length!==p&&f(s,"invalid nonce length"),o=d(t),s.push(o),m(s,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&f(s,"nonce_increment must be an unsigned integer"),n=k(s,n,"key");var i,v=0|r._crypto_stream_chacha20_keybytes();n.length!==v&&f(s,"invalid key length"),i=d(n),s.push(i);var x=new l(0|h),E=x.address;if(s.push(E),0===r._crypto_stream_chacha20_xor_ic(E,c,h,0,o,a,0,i)){var w=y(x,_);return g(s),w}b(s,"invalid usage")}function dt(e){var t=[];u(e);var a=new l(0|r._crypto_stream_keybytes()),n=a.address;t.push(n),r._crypto_stream_keygen(n);var _=y(a,e);return g(t),_}function vt(e){var t=[];u(e);var a=new l(0|r._crypto_stream_xchacha20_keybytes()),n=a.address;t.push(n),r._crypto_stream_xchacha20_keygen(n);var _=y(a,e);return g(t),_}function gt(e,t,a,n){var _=[];u(n);var s=d(e=k(_,e,"input_message")),c=e.length;_.push(s),t=k(_,t,"nonce");var h,o=0|r._crypto_stream_xchacha20_noncebytes();t.length!==o&&f(_,"invalid nonce length"),h=d(t),_.push(h),a=k(_,a,"key");var p,i=0|r._crypto_stream_xchacha20_keybytes();a.length!==i&&f(_,"invalid key length"),p=d(a),_.push(p);var v=new l(0|c),m=v.address;if(_.push(m),0===r._crypto_stream_xchacha20_xor(m,s,c,0,h,p)){var x=y(v,n);return g(_),x}b(_,"invalid usage")}function bt(e,t,a,n,_){var s=[];u(_);var c=d(e=k(s,e,"input_message")),h=e.length;s.push(c),t=k(s,t,"nonce");var o,p=0|r._crypto_stream_xchacha20_noncebytes();t.length!==p&&f(s,"invalid nonce length"),o=d(t),s.push(o),m(s,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&f(s,"nonce_increment must be an unsigned integer"),n=k(s,n,"key");var i,v=0|r._crypto_stream_xchacha20_keybytes();n.length!==v&&f(s,"invalid key length"),i=d(n),s.push(i);var x=new l(0|h),E=x.address;if(s.push(E),0===r._crypto_stream_xchacha20_xor_ic(E,c,h,0,o,a,0,i)){var w=y(x,_);return g(s),w}b(s,"invalid usage")}function ft(e,t){var a=[];u(t),m(a,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&f(a,"length must be an unsigned integer");var n=new l(0|e),_=n.address;a.push(_),r._randombytes_buf(_,e);var s=y(n,t);return g(a),s}function mt(e,t,a){var n=[];u(a),m(n,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&f(n,"length must be an unsigned integer"),t=k(n,t,"seed");var _,s=0|r._randombytes_seedbytes();t.length!==s&&f(n,"invalid seed length"),_=d(t),n.push(_);var c=new l(0|e),h=c.address;n.push(h),r._randombytes_buf_deterministic(h,e,_);var o=y(c,a);return g(n),o}function kt(e){u(e),r._randombytes_close()}function xt(e){u(e);var t=r._randombytes_random()>>>0;return g([]),t}function Et(e,t){var a=[];u(t);for(var n=r._malloc(24),_=0;_<6;_++)r.setValue(n+4*_,r.Runtime.addFunction(e[["implementation_name","random","stir","uniform","buf","close"][_]]),"i32");0!=(0|r._randombytes_set_implementation(n))&&b(a,"unsupported implementation"),g(a)}function wt(e){u(e),r._randombytes_stir()}function St(e,t){var a=[];u(t),m(a,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&f(a,"upper_bound must be an unsigned integer");var n=r._randombytes_uniform(e)>>>0;return g(a),n}function Tt(){var e=r._sodium_version_string(),t=r.UTF8ToString(e);return g([]),t}return l.prototype.to_Uint8Array=function(){var e=new Uint8Array(this.length);return e.set(r.HEAPU8.subarray(this.address,this.address+this.length)),e},e.add=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can added");var r=e.length,a=0,n=0;if(t.length!=e.length)throw new TypeError("Arguments must have the same length");for(n=0;n<r;n++)a>>=8,a+=e[n]+t[r],e[n]=255&a},e.base64_variants=h,e.compare=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var r=0,a=1,n=e.length;n-- >0;)r|=t[n]-e[n]>>8&a,a&=(t[n]^e[n])-1>>8;return r+r+a-1},e.from_base64=function(e,t){t=o(t);var a,n=[],_=new l(3*(e=k(n,e,"input")).length/4),s=d(e),c=v(4),h=v(4);return n.push(s),n.push(_.address),n.push(_.result_bin_len_p),n.push(_.b64_end_p),0!==r._sodium_base642bin(_.address,_.length,s,e.length,0,c,h,t)&&b(n,"invalid input"),r.getValue(h,"i32")-s!==e.length&&b(n,"incomplete input"),_.length=r.getValue(c,"i32"),a=_.to_Uint8Array(),g(n),a},e.from_hex=function(e){var t,a=[],n=new l((e=k(a,e,"input")).length/2),_=d(e),s=v(4);return a.push(_),a.push(n.address),a.push(n.hex_end_p),0!==r._sodium_hex2bin(n.address,n.length,_,e.length,0,0,s)&&b(a,"invalid input"),r.getValue(s,"i32")-_!==e.length&&b(a,"incomplete input"),t=n.to_Uint8Array(),g(a),t},e.from_string=_,e.increment=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be incremented");for(var t=256,r=0,a=e.length;r<a;r++)t>>=8,t+=e[r],e[r]=255&t},e.is_zero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var t=0,r=0,a=e.length;r<a;r++)t|=e[r];return 0===t},e.libsodium=t,e.memcmp=function(e,t){if(!(e instanceof Uint8Array&&t instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==t.length)throw new TypeError("Only instances of identical length can be compared");for(var r=0,a=0,n=e.length;a<n;a++)r|=e[a]^t[a];return 0===r},e.memzero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be wiped");for(var t=0,r=e.length;t<r;t++)e[t]=0},e.output_formats=function(){return["uint8array","text","hex","base64"]},e.pad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var a,n=[],_=v(4),s=1,c=0,h=0|e.length,o=new l(h+t);n.push(_),n.push(o.address);for(var p=o.address,y=o.address+h+t;p<y;p++)r.HEAPU8[p]=e[c],c+=s=1&~((65535&((h-=s)>>>48|h>>>32|h>>>16|h))-1>>16);return 0!==r._sodium_pad(_,o.address,e.length,t,o.length)&&b(n,"internal error"),o.length=r.getValue(_,"i32"),a=o.to_Uint8Array(),g(n),a},e.unpad=function(e,t){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((t|=0)<=0)throw new Error("block size must be > 0");var a=[],n=d(e),_=v(4);return a.push(n),a.push(_),0!==r._sodium_unpad(_,n,e.length,t)&&b(a,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,r.getValue(_,"i32")),g(a),e},e.ready=n,e.symbols=function(){return Object.keys(e).sort()},e.to_base64=p,e.to_hex=c,e.to_string=s,e}var r="object"==typeof e.sodium&&"function"==typeof e.sodium.onload?e.sodium.onload:null;"function"==typeof define&&define.amd?define(["exports","libsodium-sumo"],t):"object"==typeof exports&&"string"!=typeof exports.nodeName?t(exports,require("libsodium-sumo")):e.sodium=t(e.commonJsStrict={},e.libsodium),r&&e.sodium.ready.then(function(){r(e.sodium)})}(this); |
{ | ||
"name": "libsodium-wrappers-sumo", | ||
"version": "0.7.4", | ||
"description": | ||
"The Sodium cryptographic library compiled to pure JavaScript (wrappers, sumo variant)", | ||
"version": "0.7.5", | ||
"description": "The Sodium cryptographic library compiled to pure JavaScript (wrappers, sumo variant)", | ||
"main": "dist/modules-sumo/libsodium-wrappers.js", | ||
"files": ["dist/modules-sumo/libsodium-wrappers.js", "package.json"], | ||
"files": [ | ||
"dist/modules-sumo/libsodium-wrappers.js", | ||
"package.json" | ||
], | ||
"repository": { | ||
@@ -13,3 +15,3 @@ "type": "git", | ||
"dependencies": { | ||
"libsodium-sumo": "0.7.4" | ||
"libsodium-sumo": "0.7.5" | ||
}, | ||
@@ -31,3 +33,6 @@ "keywords": [ | ||
"author": "Ahmad Ben Mrad (@BatikhSouri)", | ||
"contributors": ["Frank Denis (@jedisct1)", "Ryan Lester (@buu700)"], | ||
"contributors": [ | ||
"Frank Denis (@jedisct1)", | ||
"Ryan Lester (@buu700)" | ||
], | ||
"license": "ISC", | ||
@@ -38,3 +43,5 @@ "bugs": { | ||
"homepage": "https://github.com/jedisct1/libsodium.js", | ||
"browser": { "fs": false } | ||
} | ||
"browser": { | ||
"fs": false | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
236
71656
4
+ Addedlibsodium-sumo@0.7.5(transitive)
- Removedlibsodium-sumo@0.7.4(transitive)
Updatedlibsodium-sumo@0.7.5