libsodium-wrappers
Version:
The Sodium cryptographic library compiled to pure JavaScript (wrappers)
1 lines • 112 kB
JavaScript
import e from"libsodium";let r;const t={},a=e.ready.then(function(){function a(){if(r._sodium_init()<0)throw new Error("libsodium was not correctly initialized.");for(var e=["crypto_aead_aegis128l_decrypt","crypto_aead_aegis128l_decrypt_detached","crypto_aead_aegis128l_encrypt","crypto_aead_aegis128l_encrypt_detached","crypto_aead_aegis128l_keygen","crypto_aead_aegis256_decrypt","crypto_aead_aegis256_decrypt_detached","crypto_aead_aegis256_encrypt","crypto_aead_aegis256_encrypt_detached","crypto_aead_aegis256_keygen","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_final","crypto_auth_hmacsha256_init","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_update","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512256","crypto_auth_hmacsha512256_final","crypto_auth_hmacsha512256_init","crypto_auth_hmacsha512256_keygen","crypto_auth_hmacsha512256_update","crypto_auth_hmacsha512256_verify","crypto_auth_hmacsha512_final","crypto_auth_hmacsha512_init","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_update","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_beforenm","crypto_box_curve25519xchacha20poly1305_detached","crypto_box_curve25519xchacha20poly1305_detached_afternm","crypto_box_curve25519xchacha20poly1305_easy","crypto_box_curve25519xchacha20poly1305_easy_afternm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_open_detached","crypto_box_curve25519xchacha20poly1305_open_detached_afternm","crypto_box_curve25519xchacha20poly1305_open_easy","crypto_box_curve25519xchacha20poly1305_open_easy_afternm","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_curve25519xchacha20poly1305_seed_keypair","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_core_ed25519_add","crypto_core_ed25519_from_hash","crypto_core_ed25519_from_uniform","crypto_core_ed25519_is_valid_point","crypto_core_ed25519_random","crypto_core_ed25519_scalar_add","crypto_core_ed25519_scalar_complement","crypto_core_ed25519_scalar_invert","crypto_core_ed25519_scalar_mul","crypto_core_ed25519_scalar_negate","crypto_core_ed25519_scalar_random","crypto_core_ed25519_scalar_reduce","crypto_core_ed25519_scalar_sub","crypto_core_ed25519_sub","crypto_core_hchacha20","crypto_core_hsalsa20","crypto_core_ristretto255_add","crypto_core_ristretto255_from_hash","crypto_core_ristretto255_is_valid_point","crypto_core_ristretto255_random","crypto_core_ristretto255_scalar_add","crypto_core_ristretto255_scalar_complement","crypto_core_ristretto255_scalar_invert","crypto_core_ristretto255_scalar_mul","crypto_core_ristretto255_scalar_negate","crypto_core_ristretto255_scalar_random","crypto_core_ristretto255_scalar_reduce","crypto_core_ristretto255_scalar_sub","crypto_core_ristretto255_sub","crypto_generichash","crypto_generichash_blake2b_salt_personal","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha256_final","crypto_hash_sha256_init","crypto_hash_sha256_update","crypto_hash_sha512","crypto_hash_sha512_final","crypto_hash_sha512_init","crypto_hash_sha512_update","crypto_ipcrypt_decrypt","crypto_ipcrypt_encrypt","crypto_ipcrypt_keygen","crypto_ipcrypt_nd_decrypt","crypto_ipcrypt_nd_encrypt","crypto_ipcrypt_ndx_decrypt","crypto_ipcrypt_ndx_encrypt","crypto_ipcrypt_ndx_keygen","crypto_ipcrypt_pfx_decrypt","crypto_ipcrypt_pfx_encrypt","crypto_ipcrypt_pfx_keygen","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_needs_rehash","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_scalarmult_ed25519","crypto_scalarmult_ed25519_base","crypto_scalarmult_ed25519_base_noclamp","crypto_scalarmult_ed25519_noclamp","crypto_scalarmult_ristretto255","crypto_scalarmult_ristretto255_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","crypto_xof_shake128","crypto_xof_shake128_init","crypto_xof_shake128_init_with_domain","crypto_xof_shake128_squeeze","crypto_xof_shake128_update","crypto_xof_shake256","crypto_xof_shake256_init","crypto_xof_shake256_init_with_domain","crypto_xof_shake256_squeeze","crypto_xof_shake256_update","crypto_xof_turboshake128","crypto_xof_turboshake128_init","crypto_xof_turboshake128_init_with_domain","crypto_xof_turboshake128_squeeze","crypto_xof_turboshake128_update","crypto_xof_turboshake256","crypto_xof_turboshake256_init","crypto_xof_turboshake256_init_with_domain","crypto_xof_turboshake256_squeeze","crypto_xof_turboshake256_update","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_bin2ip","sodium_ip2bin","sodium_version_string"],a=[L,O,U,P,C,R,X,D,G,F,V,q,z,W,H,j,J,Q,Z,$,ee,re,te,ae,_e,ne,se,ce,oe,pe,he,ye,ie,le,ue,de,ve,ge,be,fe,me,xe,Ee,ke,Se,Te,we,Ye,Be,Ae,Me,Ie,Ke,Ne,Le,Oe,Ue,Pe,Ce,Re,Xe,De,Ge,Fe,Ve,qe,ze,We,He,je,Je,Qe,Ze,$e,er,rr,tr,ar,_r,nr,sr,cr,or,pr,hr,yr,ir,lr,ur,dr,vr,gr,br,fr,mr,xr,Er,kr,Sr,Tr,wr,Yr,Br,Ar,Mr,Ir,Kr,Nr,Lr,Or,Ur,Pr,Cr,Rr,Xr,Dr,Gr,Fr,Vr,qr,zr,Wr,Hr,jr,Jr,Qr,Zr,$r,et,rt,tt,at,_t,nt,st,ct,ot,pt,ht,yt,it,lt,ut,dt,vt,gt,bt,ft,mt,xt,Et,kt,St,Tt,wt,Yt,Bt,At,Mt,It,Kt,Nt,Lt,Ot,Ut,Pt,Ct,Rt,Xt,Dt,Gt,Ft,Vt,qt,zt,Wt,Ht,jt,Jt,Qt,Zt,$t,ea,ra,ta,aa,_a,na,sa,ca,oa,pa,ha,ya,ia,la,ua,da,va,ga,ba,fa,ma,xa,Ea,ka,Sa,Ta,wa,Ya,Ba,Aa,Ma,Ia,Ka,Na,La,Oa,Ua,Pa,Ca],_=0;_<a.length;_++)"function"==typeof r["_"+e[_]]&&(t[e[_]]=a[_]);var n=["SODIUM_LIBRARY_VERSION_MAJOR","SODIUM_LIBRARY_VERSION_MINOR","crypto_aead_aegis128l_ABYTES","crypto_aead_aegis128l_KEYBYTES","crypto_aead_aegis128l_MESSAGEBYTES_MAX","crypto_aead_aegis128l_NPUBBYTES","crypto_aead_aegis128l_NSECBYTES","crypto_aead_aegis256_ABYTES","crypto_aead_aegis256_KEYBYTES","crypto_aead_aegis256_MESSAGEBYTES_MAX","crypto_aead_aegis256_NPUBBYTES","crypto_aead_aegis256_NSECBYTES","crypto_aead_aes256gcm_ABYTES","crypto_aead_aes256gcm_KEYBYTES","crypto_aead_aes256gcm_MESSAGEBYTES_MAX","crypto_aead_aes256gcm_NPUBBYTES","crypto_aead_aes256gcm_NSECBYTES","crypto_aead_chacha20poly1305_ABYTES","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_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_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_hmacsha512256_BYTES","crypto_auth_hmacsha512256_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_BEFORENMBYTES","crypto_box_curve25519xchacha20poly1305_MACBYTES","crypto_box_curve25519xchacha20poly1305_MESSAGEBYTES_MAX","crypto_box_curve25519xchacha20poly1305_NONCEBYTES","crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES","crypto_box_curve25519xchacha20poly1305_SEALBYTES","crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES","crypto_box_curve25519xchacha20poly1305_SEEDBYTES","crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES","crypto_box_curve25519xsalsa20poly1305_MACBYTES","crypto_box_curve25519xsalsa20poly1305_MESSAGEBYTES_MAX","crypto_box_curve25519xsalsa20poly1305_NONCEBYTES","crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES","crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES","crypto_box_curve25519xsalsa20poly1305_SEEDBYTES","crypto_core_ed25519_BYTES","crypto_core_ed25519_HASHBYTES","crypto_core_ed25519_NONREDUCEDSCALARBYTES","crypto_core_ed25519_SCALARBYTES","crypto_core_ed25519_UNIFORMBYTES","crypto_core_hchacha20_CONSTBYTES","crypto_core_hchacha20_INPUTBYTES","crypto_core_hchacha20_KEYBYTES","crypto_core_hchacha20_OUTPUTBYTES","crypto_core_hsalsa20_CONSTBYTES","crypto_core_hsalsa20_INPUTBYTES","crypto_core_hsalsa20_KEYBYTES","crypto_core_hsalsa20_OUTPUTBYTES","crypto_core_ristretto255_BYTES","crypto_core_ristretto255_HASHBYTES","crypto_core_ristretto255_NONREDUCEDSCALARBYTES","crypto_core_ristretto255_SCALARBYTES","crypto_core_salsa2012_CONSTBYTES","crypto_core_salsa2012_INPUTBYTES","crypto_core_salsa2012_KEYBYTES","crypto_core_salsa2012_OUTPUTBYTES","crypto_core_salsa208_CONSTBYTES","crypto_core_salsa208_INPUTBYTES","crypto_core_salsa208_KEYBYTES","crypto_core_salsa208_OUTPUTBYTES","crypto_core_salsa20_CONSTBYTES","crypto_core_salsa20_INPUTBYTES","crypto_core_salsa20_KEYBYTES","crypto_core_salsa20_OUTPUTBYTES","crypto_generichash_BYTES","crypto_generichash_BYTES_MAX","crypto_generichash_BYTES_MIN","crypto_generichash_KEYBYTES","crypto_generichash_KEYBYTES_MAX","crypto_generichash_KEYBYTES_MIN","crypto_generichash_blake2b_BYTES","crypto_generichash_blake2b_BYTES_MAX","crypto_generichash_blake2b_BYTES_MIN","crypto_generichash_blake2b_KEYBYTES","crypto_generichash_blake2b_KEYBYTES_MAX","crypto_generichash_blake2b_KEYBYTES_MIN","crypto_generichash_blake2b_PERSONALBYTES","crypto_generichash_blake2b_SALTBYTES","crypto_hash_BYTES","crypto_hash_sha256_BYTES","crypto_hash_sha512_BYTES","crypto_ipcrypt_BYTES","crypto_ipcrypt_KEYBYTES","crypto_ipcrypt_NDX_INPUTBYTES","crypto_ipcrypt_NDX_KEYBYTES","crypto_ipcrypt_NDX_OUTPUTBYTES","crypto_ipcrypt_NDX_TWEAKBYTES","crypto_ipcrypt_ND_INPUTBYTES","crypto_ipcrypt_ND_KEYBYTES","crypto_ipcrypt_ND_OUTPUTBYTES","crypto_ipcrypt_ND_TWEAKBYTES","crypto_ipcrypt_PFX_BYTES","crypto_ipcrypt_PFX_KEYBYTES","crypto_kdf_BYTES_MAX","crypto_kdf_BYTES_MIN","crypto_kdf_CONTEXTBYTES","crypto_kdf_KEYBYTES","crypto_kdf_blake2b_BYTES_MAX","crypto_kdf_blake2b_BYTES_MIN","crypto_kdf_blake2b_CONTEXTBYTES","crypto_kdf_blake2b_KEYBYTES","crypto_kdf_hkdf_sha256_BYTES_MAX","crypto_kdf_hkdf_sha256_BYTES_MIN","crypto_kdf_hkdf_sha256_KEYBYTES","crypto_kdf_hkdf_sha512_BYTES_MAX","crypto_kdf_hkdf_sha512_BYTES_MIN","crypto_kdf_hkdf_sha512_KEYBYTES","crypto_kx_PUBLICKEYBYTES","crypto_kx_SECRETKEYBYTES","crypto_kx_SEEDBYTES","crypto_kx_SESSIONKEYBYTES","crypto_onetimeauth_BYTES","crypto_onetimeauth_KEYBYTES","crypto_onetimeauth_poly1305_BYTES","crypto_onetimeauth_poly1305_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_argon2i_BYTES_MAX","crypto_pwhash_argon2i_BYTES_MIN","crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE","crypto_pwhash_argon2i_MEMLIMIT_MAX","crypto_pwhash_argon2i_MEMLIMIT_MIN","crypto_pwhash_argon2i_MEMLIMIT_MODERATE","crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE","crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE","crypto_pwhash_argon2i_OPSLIMIT_MAX","crypto_pwhash_argon2i_OPSLIMIT_MIN","crypto_pwhash_argon2i_OPSLIMIT_MODERATE","crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE","crypto_pwhash_argon2i_PASSWD_MAX","crypto_pwhash_argon2i_PASSWD_MIN","crypto_pwhash_argon2i_SALTBYTES","crypto_pwhash_argon2i_STRBYTES","crypto_pwhash_argon2id_BYTES_MAX","crypto_pwhash_argon2id_BYTES_MIN","crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE","crypto_pwhash_argon2id_MEMLIMIT_MAX","crypto_pwhash_argon2id_MEMLIMIT_MIN","crypto_pwhash_argon2id_MEMLIMIT_MODERATE","crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE","crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE","crypto_pwhash_argon2id_OPSLIMIT_MAX","crypto_pwhash_argon2id_OPSLIMIT_MIN","crypto_pwhash_argon2id_OPSLIMIT_MODERATE","crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE","crypto_pwhash_argon2id_PASSWD_MAX","crypto_pwhash_argon2id_PASSWD_MIN","crypto_pwhash_argon2id_SALTBYTES","crypto_pwhash_argon2id_STRBYTES","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_PASSWD_MAX","crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN","crypto_pwhash_scryptsalsa208sha256_SALTBYTES","crypto_pwhash_scryptsalsa208sha256_STRBYTES","crypto_scalarmult_BYTES","crypto_scalarmult_SCALARBYTES","crypto_scalarmult_curve25519_BYTES","crypto_scalarmult_curve25519_SCALARBYTES","crypto_scalarmult_ed25519_BYTES","crypto_scalarmult_ed25519_SCALARBYTES","crypto_scalarmult_ristretto255_BYTES","crypto_scalarmult_ristretto255_SCALARBYTES","crypto_secretbox_KEYBYTES","crypto_secretbox_MACBYTES","crypto_secretbox_MESSAGEBYTES_MAX","crypto_secretbox_NONCEBYTES","crypto_secretbox_xchacha20poly1305_KEYBYTES","crypto_secretbox_xchacha20poly1305_MACBYTES","crypto_secretbox_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretbox_xchacha20poly1305_NONCEBYTES","crypto_secretbox_xsalsa20poly1305_KEYBYTES","crypto_secretbox_xsalsa20poly1305_MACBYTES","crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX","crypto_secretbox_xsalsa20poly1305_NONCEBYTES","crypto_secretstream_xchacha20poly1305_ABYTES","crypto_secretstream_xchacha20poly1305_HEADERBYTES","crypto_secretstream_xchacha20poly1305_KEYBYTES","crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX","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_siphash24_BYTES","crypto_shorthash_siphash24_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_sign_ed25519_BYTES","crypto_sign_ed25519_MESSAGEBYTES_MAX","crypto_sign_ed25519_PUBLICKEYBYTES","crypto_sign_ed25519_SECRETKEYBYTES","crypto_sign_ed25519_SEEDBYTES","crypto_stream_KEYBYTES","crypto_stream_MESSAGEBYTES_MAX","crypto_stream_NONCEBYTES","crypto_stream_chacha20_IETF_KEYBYTES","crypto_stream_chacha20_IETF_MESSAGEBYTES_MAX","crypto_stream_chacha20_IETF_NONCEBYTES","crypto_stream_chacha20_KEYBYTES","crypto_stream_chacha20_MESSAGEBYTES_MAX","crypto_stream_chacha20_NONCEBYTES","crypto_stream_chacha20_ietf_KEYBYTES","crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX","crypto_stream_chacha20_ietf_NONCEBYTES","crypto_stream_salsa2012_KEYBYTES","crypto_stream_salsa2012_MESSAGEBYTES_MAX","crypto_stream_salsa2012_NONCEBYTES","crypto_stream_salsa208_KEYBYTES","crypto_stream_salsa208_MESSAGEBYTES_MAX","crypto_stream_salsa208_NONCEBYTES","crypto_stream_salsa20_KEYBYTES","crypto_stream_salsa20_MESSAGEBYTES_MAX","crypto_stream_salsa20_NONCEBYTES","crypto_stream_xchacha20_KEYBYTES","crypto_stream_xchacha20_MESSAGEBYTES_MAX","crypto_stream_xchacha20_NONCEBYTES","crypto_stream_xsalsa20_KEYBYTES","crypto_stream_xsalsa20_MESSAGEBYTES_MAX","crypto_stream_xsalsa20_NONCEBYTES","crypto_verify_16_BYTES","crypto_verify_32_BYTES","crypto_verify_64_BYTES","crypto_xof_shake128_BLOCKBYTES","crypto_xof_shake128_STATEBYTES","crypto_xof_shake256_BLOCKBYTES","crypto_xof_shake256_STATEBYTES","crypto_xof_turboshake128_BLOCKBYTES","crypto_xof_turboshake128_STATEBYTES","crypto_xof_turboshake256_BLOCKBYTES","crypto_xof_turboshake256_STATEBYTES"];for(_=0;_<n.length;_++)"function"==typeof(c=r["_"+n[_].toLowerCase()])&&(t[n[_]]=c());var s=["SODIUM_VERSION_STRING","crypto_pwhash_STRPREFIX","crypto_pwhash_argon2i_STRPREFIX","crypto_pwhash_argon2id_STRPREFIX","crypto_pwhash_scryptsalsa208sha256_STRPREFIX"];for(_=0;_<s.length;_++){var c;"function"==typeof(c=r["_"+s[_].toLowerCase()])&&(t[s[_]]=r.UTF8ToString(c()))}}r=e;try{a();var _=new Uint8Array([98,97,108,108,115]),n=t.randombytes_buf(t.crypto_secretbox_NONCEBYTES),s=t.randombytes_buf(t.crypto_secretbox_KEYBYTES),c=t.crypto_secretbox_easy(_,n,s),o=t.crypto_secretbox_open_easy(c,n,s);if(t.memcmp(_,o))return}catch(e){if(null==r.useBackupModule)throw new Error("Both wasm and asm failed to load"+e)}r.useBackupModule(),a()});function _(){return Object.keys(t).sort()}function n(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be incremented");for(var r=256,t=0,a=e.length;t<a;t++)r>>=8,r+=e[t],e[t]=255&r}function s(e,r){if(!(e instanceof Uint8Array&&r instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be added");var t=e.length,a=0,_=0;if(r.length!==e.length)throw new TypeError("Arguments must have the same length");for(_=0;_<t;_++)a>>=8,a+=e[_]+r[_],e[_]=255&a}function c(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var r=0,t=0,a=e.length;t<a;t++)r|=e[t];return 0===r}function o(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be wiped");for(var r=0,t=e.length;r<t;r++)e[r]=0}function p(e,r){if(!(e instanceof Uint8Array&&r instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==r.length)throw new TypeError("Only instances of identical length can be compared");for(var t=0,a=0,_=e.length;a<_;a++)t|=e[a]^r[a];return 0===t}function h(e,r){if(!(e instanceof Uint8Array&&r instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==r.length)throw new TypeError("Only instances of identical length can be compared");for(var t=0,a=1,_=e.length;_-- >0;)t|=r[_]-e[_]>>8&a,a&=(r[_]^e[_])-1>>8;return t+t+a-1}function y(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=Y(4),s=1,c=0,o=0|e.length,p=new T(o+t);_.push(n),_.push(p.address);for(var h=p.address,y=p.address+o+t;h<y;h++)r.HEAPU8[h]=e[c],c+=s=1&~((65535&((o-=s)>>>48|o>>>32|o>>>16|o))-1>>16);return 0!==r._sodium_pad(n,p.address,e.length,t,p.length)&&M(_,"internal error"),p.length=r.getValue(n,"i32"),a=p.to_Uint8Array(),A(_),a}function i(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=[],_=w(e),n=Y(4);return a.push(_),a.push(n),0!==r._sodium_unpad(n,_,e.length,t)&&M(a,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,r.getValue(n,"i32")),A(a),e}function l(e){if("function"==typeof TextEncoder)return(new TextEncoder).encode(e);e=unescape(encodeURIComponent(e));for(var r=new Uint8Array(e.length),t=0,a=e.length;t<a;t++)r[t]=e.charCodeAt(t);return r}function u(e){if("function"==typeof TextDecoder)return new TextDecoder("utf-8",{fatal:!0}).decode(e);var r=8192,t=Math.ceil(e.length/r);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 a="",_=0,n=0;n<t;n++){var s=Array.prototype.slice.call(e,n*r+_,(n+1)*r+_);if(0!==s.length){var c,o=s.length,p=0;do{var h=s[--o];h>=240?(p=4,c=!0):h>=224?(p=3,c=!0):h>=192?(p=2,c=!0):h<128&&(p=1,c=!0)}while(!c);for(var y=p-(s.length-o),i=0;i<y;i++)_--,s.pop();a+=u(s)}}return a}function d(e){var t,a=[],_=new T((e=N(a,e,"input")).length/2),n=w(e),s=Y(4);return a.push(n),a.push(_.address),a.push(s),0!==r._sodium_hex2bin(_.address,_.length,n,e.length,0,0,s)&&M(a,"invalid input"),r.getValue(s,"i32")-n!==e.length&&M(a,"incomplete input"),t=_.to_Uint8Array(),A(a),t}function v(e){e=N(null,e,"input");for(var r,t,a,_="",n=0;n<e.length;n++)a=87+(t=15&e[n])+(t-10>>8&-39)<<8|87+(r=e[n]>>>4)+(r-10>>8&-39),_+=String.fromCharCode(255&a)+String.fromCharCode(a>>>8);return _}var g={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function b(e){if(void 0===e)return g.URLSAFE_NO_PADDING;if(e!==g.ORIGINAL&&e!==g.ORIGINAL_NO_PADDING&&e!==g.URLSAFE&&e!==g.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function f(e,t){t=b(t);var a,_=[],n=new T(3*(e=N(_,e,"input")).length/4),s=w(e),c=Y(4),o=Y(4);return _.push(s),_.push(n.address),_.push(c),_.push(o),0!==r._sodium_base642bin(n.address,n.length,s,e.length,0,c,o,t)&&M(_,"invalid input"),r.getValue(o,"i32")-s!==e.length&&M(_,"incomplete input"),n.length=r.getValue(c,"i32"),a=n.to_Uint8Array(),A(_),a}function m(e,t){t=b(t);var a=[];e=N(a,e,"input");var _,n=0|Math.floor(e.length/3),s=e.length-3*n,c=4*n+(0!==s?2&t?2+(s>>>1):4:0),o=new T(c+1),p=w(e);return a.push(p),a.push(o.address),0===r._sodium_bin2base64(o.address,o.length,p,e.length,t)&&M(a,"conversion failed"),o.length=c,_=u(o.to_Uint8Array()),A(a),_}function x(){return["uint8array","text","hex","base64"]}function E(e,r){var t=r||"uint8array";if(!k(t))throw new Error(t+" output format is not available");if(e instanceof T){if("uint8array"===t)return e.to_Uint8Array();if("text"===t)return u(e.to_Uint8Array());if("hex"===t)return v(e.to_Uint8Array());if("base64"===t)return m(e.to_Uint8Array(),g.URLSAFE_NO_PADDING);throw new Error('What is output format "'+t+'"?')}if("object"==typeof e){for(var a=Object.keys(e),_={},n=0;n<a.length;n++)_[a[n]]=E(e[a[n]],t);return _}if("string"==typeof e)return e;throw new TypeError("Cannot format output")}function k(e){for(var r=["uint8array","text","hex","base64"],t=0;t<r.length;t++)if(r[t]===e)return!0;return!1}function S(e){if(e){if("string"!=typeof e)throw new TypeError("When defined, the output format must be a string");if(!k(e))throw new Error(e+" is not a supported output format")}}function T(e){this.length=e,this.address=Y(e)}function w(e){var t=Y(e.length);return r.HEAPU8.set(e,t),t}function Y(e){var t=r._malloc(e);if(0===t)throw{message:"_malloc() failed",length:e};return t}function B(e){r._free(e)}function A(e){if(e)for(var r=0;r<e.length;r++)B(e[r])}function M(e,r){throw A(e),new Error(r)}function I(e,r){throw A(e),new TypeError(r)}function K(e,r,t){null==r&&I(e,t+" cannot be null or undefined")}function N(e,r,t){return K(e,r,t),r instanceof Uint8Array?r:"string"==typeof r?l(r):void I(e,"unsupported input type for "+t)}function L(e,t,a,_,n,s){var c=[];S(s);var o=null;null!=e&&(o=w(e=N(c,e,"secret_nonce")),e.length,c.push(o)),t=N(c,t,"ciphertext");var p,h=r._crypto_aead_aegis128l_abytes(),y=t.length;y<h&&I(c,"ciphertext is too short"),p=w(t),c.push(p);var i=null,l=0;null!=a&&(i=w(a=N(c,a,"additional_data")),l=a.length,c.push(i)),_=N(c,_,"public_nonce");var u,d=0|r._crypto_aead_aegis128l_npubbytes();_.length!==d&&I(c,"invalid public_nonce length"),u=w(_),c.push(u),n=N(c,n,"key");var v,g=0|r._crypto_aead_aegis128l_keybytes();n.length!==g&&I(c,"invalid key length"),v=w(n),c.push(v);var b=new T(y-r._crypto_aead_aegis128l_abytes()|0),f=b.address;if(c.push(f),0===r._crypto_aead_aegis128l_decrypt(f,null,o,p,y,0,i,l,0,u,v)){var m=E(b,s);return A(c),m}M(c,"ciphertext cannot be decrypted using that key")}function O(e,t,a,_,n,s,c){var o=[];S(c);var p=null;null!=e&&(p=w(e=N(o,e,"secret_nonce")),e.length,o.push(p));var h=w(t=N(o,t,"ciphertext")),y=t.length;o.push(h),a=N(o,a,"mac");var i,l=0|r._crypto_aead_aegis128l_abytes();a.length!==l&&I(o,"invalid mac length"),i=w(a),o.push(i);var u=null,d=0;null!=_&&(u=w(_=N(o,_,"additional_data")),d=_.length,o.push(u)),n=N(o,n,"public_nonce");var v,g=0|r._crypto_aead_aegis128l_npubbytes();n.length!==g&&I(o,"invalid public_nonce length"),v=w(n),o.push(v),s=N(o,s,"key");var b,f=0|r._crypto_aead_aegis128l_keybytes();s.length!==f&&I(o,"invalid key length"),b=w(s),o.push(b);var m=new T(0|y),x=m.address;if(o.push(x),0===r._crypto_aead_aegis128l_decrypt_detached(x,p,h,y,0,i,u,d,0,v,b)){var k=E(m,c);return A(o),k}M(o,"ciphertext cannot be decrypted using that key")}function U(e,t,a,_,n,s){var c=[];S(s);var o=w(e=N(c,e,"message")),p=e.length;c.push(o);var h=null,y=0;null!=t&&(h=w(t=N(c,t,"additional_data")),y=t.length,c.push(h));var i=null;null!=a&&(i=w(a=N(c,a,"secret_nonce")),a.length,c.push(i)),_=N(c,_,"public_nonce");var l,u=0|r._crypto_aead_aegis128l_npubbytes();_.length!==u&&I(c,"invalid public_nonce length"),l=w(_),c.push(l),n=N(c,n,"key");var d,v=0|r._crypto_aead_aegis128l_keybytes();n.length!==v&&I(c,"invalid key length"),d=w(n),c.push(d);var g=new T(p+r._crypto_aead_aegis128l_abytes()|0),b=g.address;if(c.push(b),0===r._crypto_aead_aegis128l_encrypt(b,null,o,p,0,h,y,0,i,l,d)){var f=E(g,s);return A(c),f}M(c,"invalid usage")}function P(e,t,a,_,n,s){var c=[];S(s);var o=w(e=N(c,e,"message")),p=e.length;c.push(o);var h=null,y=0;null!=t&&(h=w(t=N(c,t,"additional_data")),y=t.length,c.push(h));var i=null;null!=a&&(i=w(a=N(c,a,"secret_nonce")),a.length,c.push(i)),_=N(c,_,"public_nonce");var l,u=0|r._crypto_aead_aegis128l_npubbytes();_.length!==u&&I(c,"invalid public_nonce length"),l=w(_),c.push(l),n=N(c,n,"key");var d,v=0|r._crypto_aead_aegis128l_keybytes();n.length!==v&&I(c,"invalid key length"),d=w(n),c.push(d);var g=new T(0|p),b=g.address;c.push(b);var f=new T(0|r._crypto_aead_aegis128l_abytes()),m=f.address;if(c.push(m),0===r._crypto_aead_aegis128l_encrypt_detached(b,m,null,o,p,0,h,y,0,i,l,d)){var x=E({ciphertext:g,mac:f},s);return A(c),x}M(c,"invalid usage")}function C(e){var t=[];S(e);var a=new T(0|r._crypto_aead_aegis128l_keybytes()),_=a.address;t.push(_),r._crypto_aead_aegis128l_keygen(_);var n=E(a,e);return A(t),n}function R(e,t,a,_,n,s){var c=[];S(s);var o=null;null!=e&&(o=w(e=N(c,e,"secret_nonce")),e.length,c.push(o)),t=N(c,t,"ciphertext");var p,h=r._crypto_aead_aegis256_abytes(),y=t.length;y<h&&I(c,"ciphertext is too short"),p=w(t),c.push(p);var i=null,l=0;null!=a&&(i=w(a=N(c,a,"additional_data")),l=a.length,c.push(i)),_=N(c,_,"public_nonce");var u,d=0|r._crypto_aead_aegis256_npubbytes();_.length!==d&&I(c,"invalid public_nonce length"),u=w(_),c.push(u),n=N(c,n,"key");var v,g=0|r._crypto_aead_aegis256_keybytes();n.length!==g&&I(c,"invalid key length"),v=w(n),c.push(v);var b=new T(y-r._crypto_aead_aegis256_abytes()|0),f=b.address;if(c.push(f),0===r._crypto_aead_aegis256_decrypt(f,null,o,p,y,0,i,l,0,u,v)){var m=E(b,s);return A(c),m}M(c,"ciphertext cannot be decrypted using that key")}function X(e,t,a,_,n,s,c){var o=[];S(c);var p=null;null!=e&&(p=w(e=N(o,e,"secret_nonce")),e.length,o.push(p));var h=w(t=N(o,t,"ciphertext")),y=t.length;o.push(h),a=N(o,a,"mac");var i,l=0|r._crypto_aead_aegis256_abytes();a.length!==l&&I(o,"invalid mac length"),i=w(a),o.push(i);var u=null,d=0;null!=_&&(u=w(_=N(o,_,"additional_data")),d=_.length,o.push(u)),n=N(o,n,"public_nonce");var v,g=0|r._crypto_aead_aegis256_npubbytes();n.length!==g&&I(o,"invalid public_nonce length"),v=w(n),o.push(v),s=N(o,s,"key");var b,f=0|r._crypto_aead_aegis256_keybytes();s.length!==f&&I(o,"invalid key length"),b=w(s),o.push(b);var m=new T(0|y),x=m.address;if(o.push(x),0===r._crypto_aead_aegis256_decrypt_detached(x,p,h,y,0,i,u,d,0,v,b)){var k=E(m,c);return A(o),k}M(o,"ciphertext cannot be decrypted using that key")}function D(e,t,a,_,n,s){var c=[];S(s);var o=w(e=N(c,e,"message")),p=e.length;c.push(o);var h=null,y=0;null!=t&&(h=w(t=N(c,t,"additional_data")),y=t.length,c.push(h));var i=null;null!=a&&(i=w(a=N(c,a,"secret_nonce")),a.length,c.push(i)),_=N(c,_,"public_nonce");var l,u=0|r._crypto_aead_aegis256_npubbytes();_.length!==u&&I(c,"invalid public_nonce length"),l=w(_),c.push(l),n=N(c,n,"key");var d,v=0|r._crypto_aead_aegis256_keybytes();n.length!==v&&I(c,"invalid key length"),d=w(n),c.push(d);var g=new T(p+r._crypto_aead_aegis256_abytes()|0),b=g.address;if(c.push(b),0===r._crypto_aead_aegis256_encrypt(b,null,o,p,0,h,y,0,i,l,d)){var f=E(g,s);return A(c),f}M(c,"invalid usage")}function G(e,t,a,_,n,s){var c=[];S(s);var o=w(e=N(c,e,"message")),p=e.length;c.push(o);var h=null,y=0;null!=t&&(h=w(t=N(c,t,"additional_data")),y=t.length,c.push(h));var i=null;null!=a&&(i=w(a=N(c,a,"secret_nonce")),a.length,c.push(i)),_=N(c,_,"public_nonce");var l,u=0|r._crypto_aead_aegis256_npubbytes();_.length!==u&&I(c,"invalid public_nonce length"),l=w(_),c.push(l),n=N(c,n,"key");var d,v=0|r._crypto_aead_aegis256_keybytes();n.length!==v&&I(c,"invalid key length"),d=w(n),c.push(d);var g=new T(0|p),b=g.address;c.push(b);var f=new T(0|r._crypto_aead_aegis256_abytes()),m=f.address;if(c.push(m),0===r._crypto_aead_aegis256_encrypt_detached(b,m,null,o,p,0,h,y,0,i,l,d)){var x=E({ciphertext:g,mac:f},s);return A(c),x}M(c,"invalid usage")}function F(e){var t=[];S(e);var a=new T(0|r._crypto_aead_aegis256_keybytes()),_=a.address;t.push(_),r._crypto_aead_aegis256_keygen(_);var n=E(a,e);return A(t),n}function V(e,t,a,_,n,s){var c=[];S(s);var o=null;null!=e&&(o=w(e=N(c,e,"secret_nonce")),e.length,c.push(o)),t=N(c,t,"ciphertext");var p,h=r._crypto_aead_chacha20poly1305_abytes(),y=t.length;y<h&&I(c,"ciphertext is too short"),p=w(t),c.push(p);var i=null,l=0;null!=a&&(i=w(a=N(c,a,"additional_data")),l=a.length,c.push(i)),_=N(c,_,"public_nonce");var u,d=0|r._crypto_aead_chacha20poly1305_npubbytes();_.length!==d&&I(c,"invalid public_nonce length"),u=w(_),c.push(u),n=N(c,n,"key");var v,g=0|r._crypto_aead_chacha20poly1305_keybytes();n.length!==g&&I(c,"invalid key length"),v=w(n),c.push(v);var b=new T(y-r._crypto_aead_chacha20poly1305_abytes()|0),f=b.address;if(c.push(f),0===r._crypto_aead_chacha20poly1305_decrypt(f,null,o,p,y,0,i,l,0,u,v)){var m=E(b,s);return A(c),m}M(c,"ciphertext cannot be decrypted using that key")}function q(e,t,a,_,n,s,c){var o=[];S(c);var p=null;null!=e&&(p=w(e=N(o,e,"secret_nonce")),e.length,o.push(p));var h=w(t=N(o,t,"ciphertext")),y=t.length;o.push(h),a=N(o,a,"mac");var i,l=0|r._crypto_box_macbytes();a.length!==l&&I(o,"invalid mac length"),i=w(a),o.push(i);var u=null,d=0;null!=_&&(u=w(_=N(o,_,"additional_data")),d=_.length,o.push(u)),n=N(o,n,"public_nonce");var v,g=0|r._crypto_aead_chacha20poly1305_npubbytes();n.length!==g&&I(o,"invalid public_nonce length"),v=w(n),o.push(v),s=N(o,s,"key");var b,f=0|r._crypto_aead_chacha20poly1305_keybytes();s.length!==f&&I(o,"invalid key length"),b=w(s),o.push(b);var m=new T(0|y),x=m.address;if(o.push(x),0===r._crypto_aead_chacha20poly1305_decrypt_detached(x,p,h,y,0,i,u,d,0,v,b)){var k=E(m,c);return A(o),k}M(o,"ciphertext cannot be decrypted using that key")}function z(e,t,a,_,n,s){var c=[];S(s);var o=w(e=N(c,e,"message")),p=e.length;c.push(o);var h=null,y=0;null!=t&&(h=w(t=N(c,t,"additional_data")),y=t.length,c.push(h));var i=null;null!=a&&(i=w(a=N(c,a,"secret_nonce")),a.length,c.push(i)),_=N(c,_,"public_nonce");var l,u=0|r._crypto_aead_chacha20poly1305_npubbytes();_.length!==u&&I(c,"invalid public_nonce length"),l=w(_),c.push(l),n=N(c,n,"key");var d,v=0|r._crypto_aead_chacha20poly1305_keybytes();n.length!==v&&I(c,"invalid key length"),d=w(n),c.push(d);var g=new T(p+r._crypto_aead_chacha20poly1305_abytes()|0),b=g.address;if(c.push(b),0===r._crypto_aead_chacha20poly1305_encrypt(b,null,o,p,0,h,y,0,i,l,d)){var f=E(g,s);return A(c),f}M(c,"invalid usage")}function W(e,t,a,_,n,s){var c=[];S(s);var o=w(e=N(c,e,"message")),p=e.length;c.push(o);var h=null,y=0;null!=t&&(h=w(t=N(c,t,"additional_data")),y=t.length,c.push(h));var i=null;null!=a&&(i=w(a=N(c,a,"secret_nonce")),a.length,c.push(i)),_=N(c,_,"public_nonce");var l,u=0|r._crypto_aead_chacha20poly1305_npubbytes();_.length!==u&&I(c,"invalid public_nonce length"),l=w(_),c.push(l),n=N(c,n,"key");var d,v=0|r._crypto_aead_chacha20poly1305_keybytes();n.length!==v&&I(c,"invalid key length"),d=w(n),c.push(d);var g=new T(0|p),b=g.address;c.push(b);var f=new T(0|r._crypto_aead_chacha20poly1305_abytes()),m=f.address;if(c.push(m),0===r._crypto_aead_chacha20poly1305_encrypt_detached(b,m,null,o,p,0,h,y,0,i,l,d)){var x=E({ciphertext:g,mac:f},s);return A(c),x}M(c,"invalid usage")}function H(e,t,a,_,n,s){var c=[];S(s);var o=null;null!=e&&(o=w(e=N(c,e,"secret_nonce")),e.length,c.push(o)),t=N(c,t,"ciphertext");var p,h=r._crypto_aead_chacha20poly1305_ietf_abytes(),y=t.length;y<h&&I(c,"ciphertext is too short"),p=w(t),c.push(p);var i=null,l=0;null!=a&&(i=w(a=N(c,a,"additional_data")),l=a.length,c.push(i)),_=N(c,_,"public_nonce");var u,d=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==d&&I(c,"invalid public_nonce length"),u=w(_),c.push(u),n=N(c,n,"key");var v,g=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();n.length!==g&&I(c,"invalid key length"),v=w(n),c.push(v);var b=new T(y-r._crypto_aead_chacha20poly1305_ietf_abytes()|0),f=b.address;if(c.push(f),0===r._crypto_aead_chacha20poly1305_ietf_decrypt(f,null,o,p,y,0,i,l,0,u,v)){var m=E(b,s);return A(c),m}M(c,"ciphertext cannot be decrypted using that key")}function j(e,t,a,_,n,s,c){var o=[];S(c);var p=null;null!=e&&(p=w(e=N(o,e,"secret_nonce")),e.length,o.push(p));var h=w(t=N(o,t,"ciphertext")),y=t.length;o.push(h),a=N(o,a,"mac");var i,l=0|r._crypto_box_macbytes();a.length!==l&&I(o,"invalid mac length"),i=w(a),o.push(i);var u=null,d=0;null!=_&&(u=w(_=N(o,_,"additional_data")),d=_.length,o.push(u)),n=N(o,n,"public_nonce");var v,g=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();n.length!==g&&I(o,"invalid public_nonce length"),v=w(n),o.push(v),s=N(o,s,"key");var b,f=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==f&&I(o,"invalid key length"),b=w(s),o.push(b);var m=new T(0|y),x=m.address;if(o.push(x),0===r._crypto_aead_chacha20poly1305_ietf_decrypt_detached(x,p,h,y,0,i,u,d,0,v,b)){var k=E(m,c);return A(o),k}M(o,"ciphertext cannot be decrypted using that key")}function J(e,t,a,_,n,s){var c=[];S(s);var o=w(e=N(c,e,"message")),p=e.length;c.push(o);var h=null,y=0;null!=t&&(h=w(t=N(c,t,"additional_data")),y=t.length,c.push(h));var i=null;null!=a&&(i=w(a=N(c,a,"secret_nonce")),a.length,c.push(i)),_=N(c,_,"public_nonce");var l,u=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==u&&I(c,"invalid public_nonce length"),l=w(_),c.push(l),n=N(c,n,"key");var d,v=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();n.length!==v&&I(c,"invalid key length"),d=w(n),c.push(d);var g=new T(p+r._crypto_aead_chacha20poly1305_ietf_abytes()|0),b=g.address;if(c.push(b),0===r._crypto_aead_chacha20poly1305_ietf_encrypt(b,null,o,p,0,h,y,0,i,l,d)){var f=E(g,s);return A(c),f}M(c,"invalid usage")}function Q(e,t,a,_,n,s){var c=[];S(s);var o=w(e=N(c,e,"message")),p=e.length;c.push(o);var h=null,y=0;null!=t&&(h=w(t=N(c,t,"additional_data")),y=t.length,c.push(h));var i=null;null!=a&&(i=w(a=N(c,a,"secret_nonce")),a.length,c.push(i)),_=N(c,_,"public_nonce");var l,u=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==u&&I(c,"invalid public_nonce length"),l=w(_),c.push(l),n=N(c,n,"key");var d,v=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();n.length!==v&&I(c,"invalid key length"),d=w(n),c.push(d);var g=new T(0|p),b=g.address;c.push(b);var f=new T(0|r._crypto_aead_chacha20poly1305_ietf_abytes()),m=f.address;if(c.push(m),0===r._crypto_aead_chacha20poly1305_ietf_encrypt_detached(b,m,null,o,p,0,h,y,0,i,l,d)){var x=E({ciphertext:g,mac:f},s);return A(c),x}M(c,"invalid usage")}function Z(e){var t=[];S(e);var a=new T(0|r._crypto_aead_chacha20poly1305_ietf_keybytes()),_=a.address;t.push(_),r._crypto_aead_chacha20poly1305_ietf_keygen(_);var n=E(a,e);return A(t),n}function $(e){var t=[];S(e);var a=new T(0|r._crypto_aead_chacha20poly1305_keybytes()),_=a.address;t.push(_),r._crypto_aead_chacha20poly1305_keygen(_);var n=E(a,e);return A(t),n}function ee(e,t,a,_,n,s){var c=[];S(s);var o=null;null!=e&&(o=w(e=N(c,e,"secret_nonce")),e.length,c.push(o)),t=N(c,t,"ciphertext");var p,h=r._crypto_aead_xchacha20poly1305_ietf_abytes(),y=t.length;y<h&&I(c,"ciphertext is too short"),p=w(t),c.push(p);var i=null,l=0;null!=a&&(i=w(a=N(c,a,"additional_data")),l=a.length,c.push(i)),_=N(c,_,"public_nonce");var u,d=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==d&&I(c,"invalid public_nonce length"),u=w(_),c.push(u),n=N(c,n,"key");var v,g=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();n.length!==g&&I(c,"invalid key length"),v=w(n),c.push(v);var b=new T(y-r._crypto_aead_xchacha20poly1305_ietf_abytes()|0),f=b.address;if(c.push(f),0===r._crypto_aead_xchacha20poly1305_ietf_decrypt(f,null,o,p,y,0,i,l,0,u,v)){var m=E(b,s);return A(c),m}M(c,"ciphertext cannot be decrypted using that key")}function re(e,t,a,_,n,s,c){var o=[];S(c);var p=null;null!=e&&(p=w(e=N(o,e,"secret_nonce")),e.length,o.push(p));var h=w(t=N(o,t,"ciphertext")),y=t.length;o.push(h),a=N(o,a,"mac");var i,l=0|r._crypto_box_macbytes();a.length!==l&&I(o,"invalid mac length"),i=w(a),o.push(i);var u=null,d=0;null!=_&&(u=w(_=N(o,_,"additional_data")),d=_.length,o.push(u)),n=N(o,n,"public_nonce");var v,g=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();n.length!==g&&I(o,"invalid public_nonce length"),v=w(n),o.push(v),s=N(o,s,"key");var b,f=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==f&&I(o,"invalid key length"),b=w(s),o.push(b);var m=new T(0|y),x=m.address;if(o.push(x),0===r._crypto_aead_xchacha20poly1305_ietf_decrypt_detached(x,p,h,y,0,i,u,d,0,v,b)){var k=E(m,c);return A(o),k}M(o,"ciphertext cannot be decrypted using that key")}function te(e,t,a,_,n,s){var c=[];S(s);var o=w(e=N(c,e,"message")),p=e.length;c.push(o);var h=null,y=0;null!=t&&(h=w(t=N(c,t,"additional_data")),y=t.length,c.push(h));var i=null;null!=a&&(i=w(a=N(c,a,"secret_nonce")),a.length,c.push(i)),_=N(c,_,"public_nonce");var l,u=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==u&&I(c,"invalid public_nonce length"),l=w(_),c.push(l),n=N(c,n,"key");var d,v=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();n.length!==v&&I(c,"invalid key length"),d=w(n),c.push(d);var g=new T(p+r._crypto_aead_xchacha20poly1305_ietf_abytes()|0),b=g.address;if(c.push(b),0===r._crypto_aead_xchacha20poly1305_ietf_encrypt(b,null,o,p,0,h,y,0,i,l,d)){var f=E(g,s);return A(c),f}M(c,"invalid usage")}function ae(e,t,a,_,n,s){var c=[];S(s);var o=w(e=N(c,e,"message")),p=e.length;c.push(o);var h=null,y=0;null!=t&&(h=w(t=N(c,t,"additional_data")),y=t.length,c.push(h));var i=null;null!=a&&(i=w(a=N(c,a,"secret_nonce")),a.length,c.push(i)),_=N(c,_,"public_nonce");var l,u=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==u&&I(c,"invalid public_nonce length"),l=w(_),c.push(l),n=N(c,n,"key");var d,v=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();n.length!==v&&I(c,"invalid key length"),d=w(n),c.push(d);var g=new T(0|p),b=g.address;c.push(b);var f=new T(0|r._crypto_aead_xchacha20poly1305_ietf_abytes()),m=f.address;if(c.push(m),0===r._crypto_aead_xchacha20poly1305_ietf_encrypt_detached(b,m,null,o,p,0,h,y,0,i,l,d)){var x=E({ciphertext:g,mac:f},s);return A(c),x}M(c,"invalid usage")}function _e(e){var t=[];S(e);var a=new T(0|r._crypto_aead_xchacha20poly1305_ietf_keybytes()),_=a.address;t.push(_),r._crypto_aead_xchacha20poly1305_ietf_keygen(_);var n=E(a,e);return A(t),n}function ne(e,t,a){var _=[];S(a);var n=w(e=N(_,e,"message")),s=e.length;_.push(n),t=N(_,t,"key");var c,o=0|r._crypto_auth_keybytes();t.length!==o&&I(_,"invalid key length"),c=w(t),_.push(c);var p=new T(0|r._crypto_auth_bytes()),h=p.address;if(_.push(h),!(0|r._crypto_auth(h,n,s,0,c))){var y=E(p,a);return A(_),y}M(_,"invalid usage")}function se(e,t,a){var _=[];S(a);var n=w(e=N(_,e,"message")),s=e.length;_.push(n),t=N(_,t,"key");var c,o=0|r._crypto_auth_hmacsha256_keybytes();t.length!==o&&I(_,"invalid key length"),c=w(t),_.push(c);var p=new T(0|r._crypto_auth_hmacsha256_bytes()),h=p.address;if(_.push(h),!(0|r._crypto_auth_hmacsha256(h,n,s,0,c))){var y=E(p,a);return A(_),y}M(_,"invalid usage")}function ce(e,t){var a=[];S(t),K(a,e,"state_address");var _=new T(0|r._crypto_auth_hmacsha256_bytes()),n=_.address;if(a.push(n),!(0|r._crypto_auth_hmacsha256_final(e,n))){var s=(r._free(e),E(_,t));return A(a),s}M(a,"invalid usage")}function oe(e,t){var a=[];S(t);var _=null,n=0;null!=e&&(_=w(e=N(a,e,"key")),n=e.length,a.push(_));var s=new T(208).address;if(!(0|r._crypto_auth_hmacsha256_init(s,_,n))){var c=s;return A(a),c}M(a,"invalid usage")}function pe(e){var t=[];S(e);var a=new T(0|r._crypto_auth_hmacsha256_keybytes()),_=a.address;t.push(_),r._crypto_auth_hmacsha256_keygen(_);var n=E(a,e);return A(t),n}function he(e,t,a){var _=[];S(a),K(_,e,"state_address");var n=w(t=N(_,t,"message_chunk")),s=t.length;_.push(n),0|r._crypto_auth_hmacsha256_update(e,n,s)&&M(_,"invalid usage"),A(_)}function ye(e,t,a){var _=[];e=N(_,e,"tag");var n,s=0|r._crypto_auth_hmacsha256_bytes();e.length!==s&&I(_,"invalid tag length"),n=w(e),_.push(n);var c=w(t=N(_,t,"message")),o=t.length;_.push(c),a=N(_,a,"key");var p,h=0|r._crypto_auth_hmacsha256_keybytes();a.length!==h&&I(_,"invalid key length"),p=w(a),_.push(p);var y=!(0|r._crypto_auth_hmacsha256_verify(n,c,o,0,p));return A(_),y}function ie(e,t,a){var _=[];S(a);var n=w(e=N(_,e,"message")),s=e.length;_.push(n),t=N(_,t,"key");var c,o=0|r._crypto_auth_hmacsha512_keybytes();t.length!==o&&I(_,"invalid key length"),c=w(t),_.push(c);var p=new T(0|r._crypto_auth_hmacsha512_bytes()),h=p.address;if(_.push(h),!(0|r._crypto_auth_hmacsha512(h,n,s,0,c))){var y=E(p,a);return A(_),y}M(_,"invalid usage")}function le(e,t,a){var _=[];S(a);var n=w(e=N(_,e,"message")),s=e.length;_.push(n),t=N(_,t,"key");var c,o=0|r._crypto_auth_hmacsha512256_keybytes();t.length!==o&&I(_,"invalid key length"),c=w(t),_.push(c);var p=new T(0|r._crypto_auth_hmacsha512256_bytes()),h=p.address;if(_.push(h),!(0|r._crypto_auth_hmacsha512256(h,n,s,0,c))){var y=E(p,a);return A(_),y}M(_,"invalid usage")}function ue(e,t){var a=[];S(t),K(a,e,"state_address");var _=new T(0|r._crypto_auth_hmacsha512256_bytes()),n=_.address;if(a.push(n),!(0|r._crypto_auth_hmacsha512256_final(e,n))){var s=(r._free(e),E(_,t));return A(a),s}M(a,"invalid usage")}function de(e,t){var a=[];S(t);var _=null,n=0;null!=e&&(_=w(e=N(a,e,"key")),n=e.length,a.push(_));var s=new T(416).address;if(!(0|r._crypto_auth_hmacsha512256_init(s,_,n))){var c=s;return A(a),c}M(a,"invalid usage")}function ve(e){var t=[];S(e);var a=new T(0|r._crypto_auth_hmacsha512256_keybytes()),_=a.address;t.push(_),r._crypto_auth_hmacsha512256_keygen(_);var n=E(a,e);return A(t),n}function ge(e,t,a){var _=[];S(a),K(_,e,"state_address");var n=w(t=N(_,t,"message_chunk")),s=t.length;_.push(n),0|r._crypto_auth_hmacsha512256_update(e,n,s)&&M(_,"invalid usage"),A(_)}function be(e,t,a){var _=[];e=N(_,e,"tag");var n,s=0|r._crypto_auth_hmacsha512256_bytes();e.length!==s&&I(_,"invalid tag length"),n=w(e),_.push(n);var c=w(t=N(_,t,"message")),o=t.length;_.push(c),a=N(_,a,"key");var p,h=0|r._crypto_auth_hmacsha512256_keybytes();a.length!==h&&I(_,"invalid key length"),p=w(a),_.push(p);var y=!(0|r._crypto_auth_hmacsha512256_verify(n,c,o,0,p));return A(_),y}function fe(e,t){var a=[];S(t),K(a,e,"state_address");var _=new T(0|r._crypto_auth_hmacsha512_bytes()),n=_.address;if(a.push(n),!(0|r._crypto_auth_hmacsha512_final(e,n))){var s=(r._free(e),E(_,t));return A(a),s}M(a,"invalid usage")}function me(e,t){var a=[];S(t);var _=null,n=0;null!=e&&(_=w(e=N(a,e,"key")),n=e.length,a.push(_));var s=new T(416).address;if(!(0|r._crypto_auth_hmacsha512_init(s,_,n))){var c=s;return A(a),c}M(a,"invalid usage")}function xe(e){var t=[];S(e);var a=new T(0|r._crypto_auth_hmacsha512_keybytes()),_=a.address;t.push(_),r._crypto_auth_hmacsha512_keygen(_);var n=E(a,e);return A(t),n}function Ee(e,t,a){var _=[];S(a),K(_,e,"state_address");var n=w(t=N(_,t,"message_chunk")),s=t.length;_.push(n),0|r._crypto_auth_hmacsha512_update(e,n,s)&&M(_,"invalid usage"),A(_)}function ke(e,t,a){var _=[];e=N(_,e,"tag");var n,s=0|r._crypto_auth_hmacsha512_bytes();e.length!==s&&I(_,"invalid tag length"),n=w(e),_.push(n);var c=w(t=N(_,t,"message")),o=t.length;_.push(c),a=N(_,a,"key");var p,h=0|r._crypto_auth_hmacsha512_keybytes();a.length!==h&&I(_,"invalid key length"),p=w(a),_.push(p);var y=!(0|r._crypto_auth_hmacsha512_verify(n,c,o,0,p));return A(_),y}function Se(e){var t=[];S(e);var a=new T(0|r._crypto_auth_keybytes()),_=a.address;t.push(_),r._crypto_auth_keygen(_);var n=E(a,e);return A(t),n}function Te(e,t,a){var _=[];e=N(_,e,"tag");var n,s=0|r._crypto_auth_bytes();e.length!==s&&I(_,"invalid tag length"),n=w(e),_.push(n);var c=w(t=N(_,t,"message")),o=t.length;_.push(c),a=N(_,a,"key");var p,h=0|r._crypto_auth_keybytes();a.length!==h&&I(_,"invalid key length"),p=w(a),_.push(p);var y=!(0|r._crypto_auth_verify(n,c,o,0,p));return A(_),y}function we(e,t,a){var _=[];S(a),e=N(_,e,"publicKey");var n,s=0|r._crypto_box_publickeybytes();e.length!==s&&I(_,"invalid publicKey length"),n=w(e),_.push(n),t=N(_,t,"privateKey");var c,o=0|r._crypto_box_secretkeybytes();t.length!==o&&I(_,"invalid privateKey length"),c=w(t),_.push(c);var p=new T(0|r._crypto_box_beforenmbytes()),h=p.address;if(_.push(h),!(0|r._crypto_box_beforenm(h,n,c))){var y=E(p,a);return A(_),y}M(_,"invalid usage")}function Ye(e,t,a){var _=[];S(a),e=N(_,e,"publicKey");var n,s=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();e.length!==s&&I(_,"invalid publicKey length"),n=w(e),_.push(n),t=N(_,t,"privateKey");var c,o=0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes();t.length!==o&&I(_,"invalid privateKey length"),c=w(t),_.push(c);var p=new T(0|r._crypto_box_curve25519xchacha20poly1305_beforenmbytes()),h=p.address;if(_.push(h),!(0|r._crypto_box_curve25519xchacha20poly1305_beforenm(h,n,c))){var y=E(p,a);return A(_),y}M(_,"invalid usage")}function Be(e,t,a,_,n){var s=[];S(n);var c=w(e=N(s,e,"message")),o=e.length;s.push(c),t=N(s,t,"nonce");var p,h=0|r._crypto_box_curve25519xchacha20poly1305_noncebytes();t.length!==h&&I(s,"invalid nonce length"),p=w(t),s.push(p),a=N(s,a,"publicKey");var y,i=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();a.length!==i&&I(s,"invalid publicKey length"),y=w(a),s.push(y),_=N(s,_,"privateKey");var l,u=0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes();_.length!==u&&I(s,"invalid privateKey length"),l=w(_),s.push(l);var d=new T(0|o),v=d.address;s.push(v);var g=new T(0|r._crypto_box_curve25519xchacha20poly1305_macbytes()),b=g.address;if(s.push(b),!(0|r._crypto_box_curve25519xchacha20poly1305_detached(v,b,c,o,0,p,y,l))){var f=E({ciphertext:d,mac:g},n);return A(s),f}M(s,"invalid usage")}function Ae(e,t,a,_){var n=[];S(_);var s=w(e=N(n,e,"message")),c=e.length;n.push(s),t=N(n,t,"nonce");var o,p=0|r._crypto_box_curve25519xchacha20poly1305_noncebytes();t.length!==p&&I(n,"invalid nonce length"),o=w(t),n.push(o),a=N(n,a,"sharedKey");var h,y=0|r._crypto_box_curve25519xchacha20poly1305_beforenmbytes();a.length!==y&&I(n,"invalid sharedKey length"),h=w(a),n.push(h);var i=new T(0|c),l=i.address;n.p