libsodium-wrappers-sumo
Version:
The Sodium cryptographic library compiled to pure JavaScript (wrappers, sumo variant)
1 lines • 102 kB
JavaScript
!function(e){function a(e,a){"use strict";var r,t="uint8array",_=a.ready.then((function(){function t(){if(0!==r._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var a=["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_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","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],t=[x,k,S,T,w,Y,B,A,M,I,K,N,L,O,U,C,P,R,X,G,D,F,V,H,W,q,j,z,J,Q,Z,$,ee,ae,re,te,_e,ne,se,ce,oe,he,pe,ye,ie,le,ue,de,ve,ge,be,fe,me,Ee,xe,ke,Se,Te,we,Ye,Be,Ae,Me,Ie,Ke,Ne,Le,Oe,Ue,Ce,Pe,Re,Xe,Ge,De,Fe,Ve,He,We,qe,je,ze,Je,Qe,Ze,$e,ea,aa,ra,ta,_a,na,sa,ca,oa,ha,pa,ya,ia,la,ua,da,va,ga,ba,fa,ma,Ea,xa,ka,Sa,Ta,wa,Ya,Ba,Aa,Ma,Ia,Ka,Na,La,Oa,Ua,Ca,Pa,Ra,Xa,Ga,Da,Fa,Va,Ha,Wa,qa,ja,za,Ja,Qa,Za,$a,er,ar,rr,tr,_r,nr,sr,cr,or,hr,pr,yr,ir,lr,ur,dr,vr,gr,br,fr,mr,Er,xr,kr,Sr,Tr,wr,Yr,Br,Ar,Mr,Ir,Kr,Nr,Lr,Or,Ur,Cr,Pr,Rr,Xr,Gr,Dr,Fr,Vr,Hr,Wr,qr],_=0;_<t.length;_++)"function"==typeof r["_"+a[_]]&&(e[a[_]]=t[_]);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_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"];for(_=0;_<n.length;_++)"function"==typeof(c=r["_"+n[_].toLowerCase()])&&(e[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()])&&(e[s[_]]=r.UTF8ToString(c()))}}r=a;try{t();var _=new Uint8Array([98,97,108,108,115]),n=e.randombytes_buf(e.crypto_secretbox_NONCEBYTES),s=e.randombytes_buf(e.crypto_secretbox_KEYBYTES),c=e.crypto_secretbox_easy(_,n,s),o=e.crypto_secretbox_open_easy(c,n,s);if(e.memcmp(_,o))return}catch(e){if(null==r.useBackupModule)throw new Error("Both wasm and asm failed to load"+e)}r.useBackupModule(),t()}));function n(e){if("function"==typeof TextEncoder)return(new TextEncoder).encode(e);e=unescape(encodeURIComponent(e));for(var a=new Uint8Array(e.length),r=0,t=e.length;r<t;r++)a[r]=e.charCodeAt(r);return a}function s(e){if("function"==typeof TextDecoder)return new TextDecoder("utf-8",{fatal:!0}).decode(e);var a=8192,r=Math.ceil(e.length/a);if(r<=1)try{return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}catch(e){throw new TypeError("The encoded data was not valid.")}for(var t="",_=0,n=0;n<r;n++){var c=Array.prototype.slice.call(e,n*a+_,(n+1)*a+_);if(0!=c.length){var o,h=c.length,p=0;do{var y=c[--h];y>=240?(p=4,o=!0):y>=224?(p=3,o=!0):y>=192?(p=2,o=!0):y<128&&(p=1,o=!0)}while(!o);for(var i=p-(c.length-h),l=0;l<i;l++)_--,c.pop();t+=s(c)}}return t}function c(e){e=E(null,e,"input");for(var a,r,t,_="",n=0;n<e.length;n++)t=87+(r=15&e[n])+(r-10>>8&-39)<<8|87+(a=e[n]>>>4)+(a-10>>8&-39),_+=String.fromCharCode(255&t)+String.fromCharCode(t>>>8);return _}var o={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function h(e){if(null==e)return o.URLSAFE_NO_PADDING;if(e!==o.ORIGINAL&&e!==o.ORIGINAL_NO_PADDING&&e!==o.URLSAFE&&e!=o.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function p(e,a){a=h(a),e=E(_,e,"input");var t,_=[],n=0|Math.floor(e.length/3),c=e.length-3*n,o=4*n+(0!==c?2&a?2+(c>>>1):4:0),p=new u(o+1),y=d(e);return _.push(y),_.push(p.address),0===r._sodium_bin2base64(p.address,p.length,y,e.length,a)&&b(_,"conversion failed"),p.length=o,t=s(p.to_Uint8Array()),g(_),t}function y(e,a){var r=a||t;if(!i(r))throw new Error(r+" output format is not available");if(e instanceof u){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(),o.URLSAFE_NO_PADDING);throw new Error('What is output format "'+r+'"?')}if("object"==typeof e){for(var _=Object.keys(e),n={},h=0;h<_.length;h++)n[_[h]]=y(e[_[h]],r);return n}if("string"==typeof e)return e;throw new TypeError("Cannot format output")}function i(e){for(var a=["uint8array","text","hex","base64"],r=0;r<a.length;r++)if(a[r]===e)return!0;return!1}function l(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 u(e){this.length=e,this.address=v(e)}function d(e){var a=v(e.length);return r.HEAPU8.set(e,a),a}function v(e){var a=r._malloc(e);if(0===a)throw{message:"_malloc() failed",length:e};return a}function g(e){if(e)for(var a=0;a<e.length;a++)t=e[a],r._free(t);var t}function b(e,a){throw g(e),new Error(a)}function f(e,a){throw g(e),new TypeError(a)}function m(e,a,r){null==a&&f(e,r+" cannot be null or undefined")}function E(e,a,r){return m(e,a,r),a instanceof Uint8Array?a:"string"==typeof a?n(a):void f(e,"unsupported input type for "+r)}function x(e,a,t,_,n,s){var c=[];l(s);var o=null;null!=e&&(o=d(e=E(c,e,"secret_nonce")),e.length,c.push(o)),a=E(c,a,"ciphertext");var h,p=r._crypto_aead_aegis128l_abytes(),i=a.length;i<p&&f(c,"ciphertext is too short"),h=d(a),c.push(h);var v=null,m=0;null!=t&&(v=d(t=E(c,t,"additional_data")),m=t.length,c.push(v)),_=E(c,_,"public_nonce");var x,k=0|r._crypto_aead_aegis128l_npubbytes();_.length!==k&&f(c,"invalid public_nonce length"),x=d(_),c.push(x),n=E(c,n,"key");var S,T=0|r._crypto_aead_aegis128l_keybytes();n.length!==T&&f(c,"invalid key length"),S=d(n),c.push(S);var w=new u(i-r._crypto_aead_aegis128l_abytes()|0),Y=w.address;if(c.push(Y),0===r._crypto_aead_aegis128l_decrypt(Y,null,o,h,i,0,v,m,0,x,S)){var B=y(w,s);return g(c),B}b(c,"ciphertext cannot be decrypted using that key")}function k(e,a,t,_,n,s,c){var o=[];l(c);var h=null;null!=e&&(h=d(e=E(o,e,"secret_nonce")),e.length,o.push(h));var p=d(a=E(o,a,"ciphertext")),i=a.length;o.push(p),t=E(o,t,"mac");var v,m=0|r._crypto_box_macbytes();t.length!==m&&f(o,"invalid mac length"),v=d(t),o.push(v);var x=null,k=0;null!=_&&(x=d(_=E(o,_,"additional_data")),k=_.length,o.push(x)),n=E(o,n,"public_nonce");var S,T=0|r._crypto_aead_aegis128l_npubbytes();n.length!==T&&f(o,"invalid public_nonce length"),S=d(n),o.push(S),s=E(o,s,"key");var w,Y=0|r._crypto_aead_aegis128l_keybytes();s.length!==Y&&f(o,"invalid key length"),w=d(s),o.push(w);var B=new u(0|i),A=B.address;if(o.push(A),0===r._crypto_aead_aegis128l_decrypt_detached(A,h,p,i,0,v,x,k,0,S,w)){var M=y(B,c);return g(o),M}b(o,"ciphertext cannot be decrypted using that key")}function S(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"message")),h=e.length;c.push(o);var p=null,i=0;null!=a&&(p=d(a=E(c,a,"additional_data")),i=a.length,c.push(p));var v=null;null!=t&&(v=d(t=E(c,t,"secret_nonce")),t.length,c.push(v)),_=E(c,_,"public_nonce");var m,x=0|r._crypto_aead_aegis128l_npubbytes();_.length!==x&&f(c,"invalid public_nonce length"),m=d(_),c.push(m),n=E(c,n,"key");var k,S=0|r._crypto_aead_aegis128l_keybytes();n.length!==S&&f(c,"invalid key length"),k=d(n),c.push(k);var T=new u(h+r._crypto_aead_aegis128l_abytes()|0),w=T.address;if(c.push(w),0===r._crypto_aead_aegis128l_encrypt(w,null,o,h,0,p,i,0,v,m,k)){var Y=y(T,s);return g(c),Y}b(c,"invalid usage")}function T(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"message")),h=e.length;c.push(o);var p=null,i=0;null!=a&&(p=d(a=E(c,a,"additional_data")),i=a.length,c.push(p));var v=null;null!=t&&(v=d(t=E(c,t,"secret_nonce")),t.length,c.push(v)),_=E(c,_,"public_nonce");var m,x=0|r._crypto_aead_aegis128l_npubbytes();_.length!==x&&f(c,"invalid public_nonce length"),m=d(_),c.push(m),n=E(c,n,"key");var k,S=0|r._crypto_aead_aegis128l_keybytes();n.length!==S&&f(c,"invalid key length"),k=d(n),c.push(k);var T=new u(0|h),w=T.address;c.push(w);var Y=new u(0|r._crypto_aead_aegis128l_abytes()),B=Y.address;if(c.push(B),0===r._crypto_aead_aegis128l_encrypt_detached(w,B,null,o,h,0,p,i,0,v,m,k)){var A=y({ciphertext:T,mac:Y},s);return g(c),A}b(c,"invalid usage")}function w(e){var a=[];l(e);var t=new u(0|r._crypto_aead_aegis128l_keybytes()),_=t.address;a.push(_),r._crypto_aead_aegis128l_keygen(_);var n=y(t,e);return g(a),n}function Y(e,a,t,_,n,s){var c=[];l(s);var o=null;null!=e&&(o=d(e=E(c,e,"secret_nonce")),e.length,c.push(o)),a=E(c,a,"ciphertext");var h,p=r._crypto_aead_aegis256_abytes(),i=a.length;i<p&&f(c,"ciphertext is too short"),h=d(a),c.push(h);var v=null,m=0;null!=t&&(v=d(t=E(c,t,"additional_data")),m=t.length,c.push(v)),_=E(c,_,"public_nonce");var x,k=0|r._crypto_aead_aegis256_npubbytes();_.length!==k&&f(c,"invalid public_nonce length"),x=d(_),c.push(x),n=E(c,n,"key");var S,T=0|r._crypto_aead_aegis256_keybytes();n.length!==T&&f(c,"invalid key length"),S=d(n),c.push(S);var w=new u(i-r._crypto_aead_aegis256_abytes()|0),Y=w.address;if(c.push(Y),0===r._crypto_aead_aegis256_decrypt(Y,null,o,h,i,0,v,m,0,x,S)){var B=y(w,s);return g(c),B}b(c,"ciphertext cannot be decrypted using that key")}function B(e,a,t,_,n,s,c){var o=[];l(c);var h=null;null!=e&&(h=d(e=E(o,e,"secret_nonce")),e.length,o.push(h));var p=d(a=E(o,a,"ciphertext")),i=a.length;o.push(p),t=E(o,t,"mac");var v,m=0|r._crypto_box_macbytes();t.length!==m&&f(o,"invalid mac length"),v=d(t),o.push(v);var x=null,k=0;null!=_&&(x=d(_=E(o,_,"additional_data")),k=_.length,o.push(x)),n=E(o,n,"public_nonce");var S,T=0|r._crypto_aead_aegis256_npubbytes();n.length!==T&&f(o,"invalid public_nonce length"),S=d(n),o.push(S),s=E(o,s,"key");var w,Y=0|r._crypto_aead_aegis256_keybytes();s.length!==Y&&f(o,"invalid key length"),w=d(s),o.push(w);var B=new u(0|i),A=B.address;if(o.push(A),0===r._crypto_aead_aegis256_decrypt_detached(A,h,p,i,0,v,x,k,0,S,w)){var M=y(B,c);return g(o),M}b(o,"ciphertext cannot be decrypted using that key")}function A(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"message")),h=e.length;c.push(o);var p=null,i=0;null!=a&&(p=d(a=E(c,a,"additional_data")),i=a.length,c.push(p));var v=null;null!=t&&(v=d(t=E(c,t,"secret_nonce")),t.length,c.push(v)),_=E(c,_,"public_nonce");var m,x=0|r._crypto_aead_aegis256_npubbytes();_.length!==x&&f(c,"invalid public_nonce length"),m=d(_),c.push(m),n=E(c,n,"key");var k,S=0|r._crypto_aead_aegis256_keybytes();n.length!==S&&f(c,"invalid key length"),k=d(n),c.push(k);var T=new u(h+r._crypto_aead_aegis256_abytes()|0),w=T.address;if(c.push(w),0===r._crypto_aead_aegis256_encrypt(w,null,o,h,0,p,i,0,v,m,k)){var Y=y(T,s);return g(c),Y}b(c,"invalid usage")}function M(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"message")),h=e.length;c.push(o);var p=null,i=0;null!=a&&(p=d(a=E(c,a,"additional_data")),i=a.length,c.push(p));var v=null;null!=t&&(v=d(t=E(c,t,"secret_nonce")),t.length,c.push(v)),_=E(c,_,"public_nonce");var m,x=0|r._crypto_aead_aegis256_npubbytes();_.length!==x&&f(c,"invalid public_nonce length"),m=d(_),c.push(m),n=E(c,n,"key");var k,S=0|r._crypto_aead_aegis256_keybytes();n.length!==S&&f(c,"invalid key length"),k=d(n),c.push(k);var T=new u(0|h),w=T.address;c.push(w);var Y=new u(0|r._crypto_aead_aegis256_abytes()),B=Y.address;if(c.push(B),0===r._crypto_aead_aegis256_encrypt_detached(w,B,null,o,h,0,p,i,0,v,m,k)){var A=y({ciphertext:T,mac:Y},s);return g(c),A}b(c,"invalid usage")}function I(e){var a=[];l(e);var t=new u(0|r._crypto_aead_aegis256_keybytes()),_=t.address;a.push(_),r._crypto_aead_aegis256_keygen(_);var n=y(t,e);return g(a),n}function K(e,a,t,_,n,s){var c=[];l(s);var o=null;null!=e&&(o=d(e=E(c,e,"secret_nonce")),e.length,c.push(o)),a=E(c,a,"ciphertext");var h,p=r._crypto_aead_chacha20poly1305_abytes(),i=a.length;i<p&&f(c,"ciphertext is too short"),h=d(a),c.push(h);var v=null,m=0;null!=t&&(v=d(t=E(c,t,"additional_data")),m=t.length,c.push(v)),_=E(c,_,"public_nonce");var x,k=0|r._crypto_aead_chacha20poly1305_npubbytes();_.length!==k&&f(c,"invalid public_nonce length"),x=d(_),c.push(x),n=E(c,n,"key");var S,T=0|r._crypto_aead_chacha20poly1305_keybytes();n.length!==T&&f(c,"invalid key length"),S=d(n),c.push(S);var w=new u(i-r._crypto_aead_chacha20poly1305_abytes()|0),Y=w.address;if(c.push(Y),0===r._crypto_aead_chacha20poly1305_decrypt(Y,null,o,h,i,0,v,m,0,x,S)){var B=y(w,s);return g(c),B}b(c,"ciphertext cannot be decrypted using that key")}function N(e,a,t,_,n,s,c){var o=[];l(c);var h=null;null!=e&&(h=d(e=E(o,e,"secret_nonce")),e.length,o.push(h));var p=d(a=E(o,a,"ciphertext")),i=a.length;o.push(p),t=E(o,t,"mac");var v,m=0|r._crypto_box_macbytes();t.length!==m&&f(o,"invalid mac length"),v=d(t),o.push(v);var x=null,k=0;null!=_&&(x=d(_=E(o,_,"additional_data")),k=_.length,o.push(x)),n=E(o,n,"public_nonce");var S,T=0|r._crypto_aead_chacha20poly1305_npubbytes();n.length!==T&&f(o,"invalid public_nonce length"),S=d(n),o.push(S),s=E(o,s,"key");var w,Y=0|r._crypto_aead_chacha20poly1305_keybytes();s.length!==Y&&f(o,"invalid key length"),w=d(s),o.push(w);var B=new u(0|i),A=B.address;if(o.push(A),0===r._crypto_aead_chacha20poly1305_decrypt_detached(A,h,p,i,0,v,x,k,0,S,w)){var M=y(B,c);return g(o),M}b(o,"ciphertext cannot be decrypted using that key")}function L(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"message")),h=e.length;c.push(o);var p=null,i=0;null!=a&&(p=d(a=E(c,a,"additional_data")),i=a.length,c.push(p));var v=null;null!=t&&(v=d(t=E(c,t,"secret_nonce")),t.length,c.push(v)),_=E(c,_,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_npubbytes();_.length!==x&&f(c,"invalid public_nonce length"),m=d(_),c.push(m),n=E(c,n,"key");var k,S=0|r._crypto_aead_chacha20poly1305_keybytes();n.length!==S&&f(c,"invalid key length"),k=d(n),c.push(k);var T=new u(h+r._crypto_aead_chacha20poly1305_abytes()|0),w=T.address;if(c.push(w),0===r._crypto_aead_chacha20poly1305_encrypt(w,null,o,h,0,p,i,0,v,m,k)){var Y=y(T,s);return g(c),Y}b(c,"invalid usage")}function O(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"message")),h=e.length;c.push(o);var p=null,i=0;null!=a&&(p=d(a=E(c,a,"additional_data")),i=a.length,c.push(p));var v=null;null!=t&&(v=d(t=E(c,t,"secret_nonce")),t.length,c.push(v)),_=E(c,_,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_npubbytes();_.length!==x&&f(c,"invalid public_nonce length"),m=d(_),c.push(m),n=E(c,n,"key");var k,S=0|r._crypto_aead_chacha20poly1305_keybytes();n.length!==S&&f(c,"invalid key length"),k=d(n),c.push(k);var T=new u(0|h),w=T.address;c.push(w);var Y=new u(0|r._crypto_aead_chacha20poly1305_abytes()),B=Y.address;if(c.push(B),0===r._crypto_aead_chacha20poly1305_encrypt_detached(w,B,null,o,h,0,p,i,0,v,m,k)){var A=y({ciphertext:T,mac:Y},s);return g(c),A}b(c,"invalid usage")}function U(e,a,t,_,n,s){var c=[];l(s);var o=null;null!=e&&(o=d(e=E(c,e,"secret_nonce")),e.length,c.push(o)),a=E(c,a,"ciphertext");var h,p=r._crypto_aead_chacha20poly1305_ietf_abytes(),i=a.length;i<p&&f(c,"ciphertext is too short"),h=d(a),c.push(h);var v=null,m=0;null!=t&&(v=d(t=E(c,t,"additional_data")),m=t.length,c.push(v)),_=E(c,_,"public_nonce");var x,k=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==k&&f(c,"invalid public_nonce length"),x=d(_),c.push(x),n=E(c,n,"key");var S,T=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();n.length!==T&&f(c,"invalid key length"),S=d(n),c.push(S);var w=new u(i-r._crypto_aead_chacha20poly1305_ietf_abytes()|0),Y=w.address;if(c.push(Y),0===r._crypto_aead_chacha20poly1305_ietf_decrypt(Y,null,o,h,i,0,v,m,0,x,S)){var B=y(w,s);return g(c),B}b(c,"ciphertext cannot be decrypted using that key")}function C(e,a,t,_,n,s,c){var o=[];l(c);var h=null;null!=e&&(h=d(e=E(o,e,"secret_nonce")),e.length,o.push(h));var p=d(a=E(o,a,"ciphertext")),i=a.length;o.push(p),t=E(o,t,"mac");var v,m=0|r._crypto_box_macbytes();t.length!==m&&f(o,"invalid mac length"),v=d(t),o.push(v);var x=null,k=0;null!=_&&(x=d(_=E(o,_,"additional_data")),k=_.length,o.push(x)),n=E(o,n,"public_nonce");var S,T=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();n.length!==T&&f(o,"invalid public_nonce length"),S=d(n),o.push(S),s=E(o,s,"key");var w,Y=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==Y&&f(o,"invalid key length"),w=d(s),o.push(w);var B=new u(0|i),A=B.address;if(o.push(A),0===r._crypto_aead_chacha20poly1305_ietf_decrypt_detached(A,h,p,i,0,v,x,k,0,S,w)){var M=y(B,c);return g(o),M}b(o,"ciphertext cannot be decrypted using that key")}function P(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"message")),h=e.length;c.push(o);var p=null,i=0;null!=a&&(p=d(a=E(c,a,"additional_data")),i=a.length,c.push(p));var v=null;null!=t&&(v=d(t=E(c,t,"secret_nonce")),t.length,c.push(v)),_=E(c,_,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==x&&f(c,"invalid public_nonce length"),m=d(_),c.push(m),n=E(c,n,"key");var k,S=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();n.length!==S&&f(c,"invalid key length"),k=d(n),c.push(k);var T=new u(h+r._crypto_aead_chacha20poly1305_ietf_abytes()|0),w=T.address;if(c.push(w),0===r._crypto_aead_chacha20poly1305_ietf_encrypt(w,null,o,h,0,p,i,0,v,m,k)){var Y=y(T,s);return g(c),Y}b(c,"invalid usage")}function R(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"message")),h=e.length;c.push(o);var p=null,i=0;null!=a&&(p=d(a=E(c,a,"additional_data")),i=a.length,c.push(p));var v=null;null!=t&&(v=d(t=E(c,t,"secret_nonce")),t.length,c.push(v)),_=E(c,_,"public_nonce");var m,x=0|r._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==x&&f(c,"invalid public_nonce length"),m=d(_),c.push(m),n=E(c,n,"key");var k,S=0|r._crypto_aead_chacha20poly1305_ietf_keybytes();n.length!==S&&f(c,"invalid key length"),k=d(n),c.push(k);var T=new u(0|h),w=T.address;c.push(w);var Y=new u(0|r._crypto_aead_chacha20poly1305_ietf_abytes()),B=Y.address;if(c.push(B),0===r._crypto_aead_chacha20poly1305_ietf_encrypt_detached(w,B,null,o,h,0,p,i,0,v,m,k)){var A=y({ciphertext:T,mac:Y},s);return g(c),A}b(c,"invalid usage")}function X(e){var a=[];l(e);var t=new u(0|r._crypto_aead_chacha20poly1305_ietf_keybytes()),_=t.address;a.push(_),r._crypto_aead_chacha20poly1305_ietf_keygen(_);var n=y(t,e);return g(a),n}function G(e){var a=[];l(e);var t=new u(0|r._crypto_aead_chacha20poly1305_keybytes()),_=t.address;a.push(_),r._crypto_aead_chacha20poly1305_keygen(_);var n=y(t,e);return g(a),n}function D(e,a,t,_,n,s){var c=[];l(s);var o=null;null!=e&&(o=d(e=E(c,e,"secret_nonce")),e.length,c.push(o)),a=E(c,a,"ciphertext");var h,p=r._crypto_aead_xchacha20poly1305_ietf_abytes(),i=a.length;i<p&&f(c,"ciphertext is too short"),h=d(a),c.push(h);var v=null,m=0;null!=t&&(v=d(t=E(c,t,"additional_data")),m=t.length,c.push(v)),_=E(c,_,"public_nonce");var x,k=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==k&&f(c,"invalid public_nonce length"),x=d(_),c.push(x),n=E(c,n,"key");var S,T=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();n.length!==T&&f(c,"invalid key length"),S=d(n),c.push(S);var w=new u(i-r._crypto_aead_xchacha20poly1305_ietf_abytes()|0),Y=w.address;if(c.push(Y),0===r._crypto_aead_xchacha20poly1305_ietf_decrypt(Y,null,o,h,i,0,v,m,0,x,S)){var B=y(w,s);return g(c),B}b(c,"ciphertext cannot be decrypted using that key")}function F(e,a,t,_,n,s,c){var o=[];l(c);var h=null;null!=e&&(h=d(e=E(o,e,"secret_nonce")),e.length,o.push(h));var p=d(a=E(o,a,"ciphertext")),i=a.length;o.push(p),t=E(o,t,"mac");var v,m=0|r._crypto_box_macbytes();t.length!==m&&f(o,"invalid mac length"),v=d(t),o.push(v);var x=null,k=0;null!=_&&(x=d(_=E(o,_,"additional_data")),k=_.length,o.push(x)),n=E(o,n,"public_nonce");var S,T=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();n.length!==T&&f(o,"invalid public_nonce length"),S=d(n),o.push(S),s=E(o,s,"key");var w,Y=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==Y&&f(o,"invalid key length"),w=d(s),o.push(w);var B=new u(0|i),A=B.address;if(o.push(A),0===r._crypto_aead_xchacha20poly1305_ietf_decrypt_detached(A,h,p,i,0,v,x,k,0,S,w)){var M=y(B,c);return g(o),M}b(o,"ciphertext cannot be decrypted using that key")}function V(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"message")),h=e.length;c.push(o);var p=null,i=0;null!=a&&(p=d(a=E(c,a,"additional_data")),i=a.length,c.push(p));var v=null;null!=t&&(v=d(t=E(c,t,"secret_nonce")),t.length,c.push(v)),_=E(c,_,"public_nonce");var m,x=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==x&&f(c,"invalid public_nonce length"),m=d(_),c.push(m),n=E(c,n,"key");var k,S=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();n.length!==S&&f(c,"invalid key length"),k=d(n),c.push(k);var T=new u(h+r._crypto_aead_xchacha20poly1305_ietf_abytes()|0),w=T.address;if(c.push(w),0===r._crypto_aead_xchacha20poly1305_ietf_encrypt(w,null,o,h,0,p,i,0,v,m,k)){var Y=y(T,s);return g(c),Y}b(c,"invalid usage")}function H(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"message")),h=e.length;c.push(o);var p=null,i=0;null!=a&&(p=d(a=E(c,a,"additional_data")),i=a.length,c.push(p));var v=null;null!=t&&(v=d(t=E(c,t,"secret_nonce")),t.length,c.push(v)),_=E(c,_,"public_nonce");var m,x=0|r._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==x&&f(c,"invalid public_nonce length"),m=d(_),c.push(m),n=E(c,n,"key");var k,S=0|r._crypto_aead_xchacha20poly1305_ietf_keybytes();n.length!==S&&f(c,"invalid key length"),k=d(n),c.push(k);var T=new u(0|h),w=T.address;c.push(w);var Y=new u(0|r._crypto_aead_xchacha20poly1305_ietf_abytes()),B=Y.address;if(c.push(B),0===r._crypto_aead_xchacha20poly1305_ietf_encrypt_detached(w,B,null,o,h,0,p,i,0,v,m,k)){var A=y({ciphertext:T,mac:Y},s);return g(c),A}b(c,"invalid usage")}function W(e){var a=[];l(e);var t=new u(0|r._crypto_aead_xchacha20poly1305_ietf_keybytes()),_=t.address;a.push(_),r._crypto_aead_xchacha20poly1305_ietf_keygen(_);var n=y(t,e);return g(a),n}function q(e,a,t){var _=[];l(t);var n=d(e=E(_,e,"message")),s=e.length;_.push(n),a=E(_,a,"key");var c,o=0|r._crypto_auth_keybytes();a.length!==o&&f(_,"invalid key length"),c=d(a),_.push(c);var h=new u(0|r._crypto_auth_bytes()),p=h.address;if(_.push(p),!(0|r._crypto_auth(p,n,s,0,c))){var i=y(h,t);return g(_),i}b(_,"invalid usage")}function j(e,a,t){var _=[];l(t);var n=d(e=E(_,e,"message")),s=e.length;_.push(n),a=E(_,a,"key");var c,o=0|r._crypto_auth_hmacsha256_keybytes();a.length!==o&&f(_,"invalid key length"),c=d(a),_.push(c);var h=new u(0|r._crypto_auth_hmacsha256_bytes()),p=h.address;if(_.push(p),!(0|r._crypto_auth_hmacsha256(p,n,s,0,c))){var i=y(h,t);return g(_),i}b(_,"invalid usage")}function z(e,a){var t=[];l(a),m(t,e,"state_address");var _=new u(0|r._crypto_auth_hmacsha256_bytes()),n=_.address;if(t.push(n),!(0|r._crypto_auth_hmacsha256_final(e,n))){var s=(r._free(e),y(_,a));return g(t),s}b(t,"invalid usage")}function J(e,a){var t=[];l(a);var _=null,n=0;null!=e&&(_=d(e=E(t,e,"key")),n=e.length,t.push(_));var s=new u(208).address;if(!(0|r._crypto_auth_hmacsha256_init(s,_,n))){var c=s;return g(t),c}b(t,"invalid usage")}function Q(e){var a=[];l(e);var t=new u(0|r._crypto_auth_hmacsha256_keybytes()),_=t.address;a.push(_),r._crypto_auth_hmacsha256_keygen(_);var n=y(t,e);return g(a),n}function Z(e,a,t){var _=[];l(t),m(_,e,"state_address");var n=d(a=E(_,a,"message_chunk")),s=a.length;_.push(n),0|r._crypto_auth_hmacsha256_update(e,n,s)&&b(_,"invalid usage"),g(_)}function $(e,a,t){var _=[];e=E(_,e,"tag");var n,s=0|r._crypto_auth_hmacsha256_bytes();e.length!==s&&f(_,"invalid tag length"),n=d(e),_.push(n);var c=d(a=E(_,a,"message")),o=a.length;_.push(c),t=E(_,t,"key");var h,p=0|r._crypto_auth_hmacsha256_keybytes();t.length!==p&&f(_,"invalid key length"),h=d(t),_.push(h);var y=!(0|r._crypto_auth_hmacsha256_verify(n,c,o,0,h));return g(_),y}function ee(e,a,t){var _=[];l(t);var n=d(e=E(_,e,"message")),s=e.length;_.push(n),a=E(_,a,"key");var c,o=0|r._crypto_auth_hmacsha512_keybytes();a.length!==o&&f(_,"invalid key length"),c=d(a),_.push(c);var h=new u(0|r._crypto_auth_hmacsha512_bytes()),p=h.address;if(_.push(p),!(0|r._crypto_auth_hmacsha512(p,n,s,0,c))){var i=y(h,t);return g(_),i}b(_,"invalid usage")}function ae(e,a,t){var _=[];l(t);var n=d(e=E(_,e,"message")),s=e.length;_.push(n),a=E(_,a,"key");var c,o=0|r._crypto_auth_hmacsha512256_keybytes();a.length!==o&&f(_,"invalid key length"),c=d(a),_.push(c);var h=new u(0|r._crypto_auth_hmacsha512256_bytes()),p=h.address;if(_.push(p),!(0|r._crypto_auth_hmacsha512256(p,n,s,0,c))){var i=y(h,t);return g(_),i}b(_,"invalid usage")}function re(e,a){var t=[];l(a),m(t,e,"state_address");var _=new u(0|r._crypto_auth_hmacsha512256_bytes()),n=_.address;if(t.push(n),!(0|r._crypto_auth_hmacsha512256_final(e,n))){var s=(r._free(e),y(_,a));return g(t),s}b(t,"invalid usage")}function te(e,a){var t=[];l(a);var _=null,n=0;null!=e&&(_=d(e=E(t,e,"key")),n=e.length,t.push(_));var s=new u(416).address;if(!(0|r._crypto_auth_hmacsha512256_init(s,_,n))){var c=s;return g(t),c}b(t,"invalid usage")}function _e(e){var a=[];l(e);var t=new u(0|r._crypto_auth_hmacsha512256_keybytes()),_=t.address;a.push(_),r._crypto_auth_hmacsha512256_keygen(_);var n=y(t,e);return g(a),n}function ne(e,a,t){var _=[];l(t),m(_,e,"state_address");var n=d(a=E(_,a,"message_chunk")),s=a.length;_.push(n),0|r._crypto_auth_hmacsha512256_update(e,n,s)&&b(_,"invalid usage"),g(_)}function se(e,a,t){var _=[];e=E(_,e,"tag");var n,s=0|r._crypto_auth_hmacsha512256_bytes();e.length!==s&&f(_,"invalid tag length"),n=d(e),_.push(n);var c=d(a=E(_,a,"message")),o=a.length;_.push(c),t=E(_,t,"key");var h,p=0|r._crypto_auth_hmacsha512256_keybytes();t.length!==p&&f(_,"invalid key length"),h=d(t),_.push(h);var y=!(0|r._crypto_auth_hmacsha512256_verify(n,c,o,0,h));return g(_),y}function ce(e,a){var t=[];l(a),m(t,e,"state_address");var _=new u(0|r._crypto_auth_hmacsha512_bytes()),n=_.address;if(t.push(n),!(0|r._crypto_auth_hmacsha512_final(e,n))){var s=(r._free(e),y(_,a));return g(t),s}b(t,"invalid usage")}function oe(e,a){var t=[];l(a);var _=null,n=0;null!=e&&(_=d(e=E(t,e,"key")),n=e.length,t.push(_));var s=new u(416).address;if(!(0|r._crypto_auth_hmacsha512_init(s,_,n))){var c=s;return g(t),c}b(t,"invalid usage")}function he(e){var a=[];l(e);var t=new u(0|r._crypto_auth_hmacsha512_keybytes()),_=t.address;a.push(_),r._crypto_auth_hmacsha512_keygen(_);var n=y(t,e);return g(a),n}function pe(e,a,t){var _=[];l(t),m(_,e,"state_address");var n=d(a=E(_,a,"message_chunk")),s=a.length;_.push(n),0|r._crypto_auth_hmacsha512_update(e,n,s)&&b(_,"invalid usage"),g(_)}function ye(e,a,t){var _=[];e=E(_,e,"tag");var n,s=0|r._crypto_auth_hmacsha512_bytes();e.length!==s&&f(_,"invalid tag length"),n=d(e),_.push(n);var c=d(a=E(_,a,"message")),o=a.length;_.push(c),t=E(_,t,"key");var h,p=0|r._crypto_auth_hmacsha512_keybytes();t.length!==p&&f(_,"invalid key length"),h=d(t),_.push(h);var y=!(0|r._crypto_auth_hmacsha512_verify(n,c,o,0,h));return g(_),y}function ie(e){var a=[];l(e);var t=new u(0|r._crypto_auth_keybytes()),_=t.address;a.push(_),r._crypto_auth_keygen(_);var n=y(t,e);return g(a),n}function le(e,a,t){var _=[];e=E(_,e,"tag");var n,s=0|r._crypto_auth_bytes();e.length!==s&&f(_,"invalid tag length"),n=d(e),_.push(n);var c=d(a=E(_,a,"message")),o=a.length;_.push(c),t=E(_,t,"key");var h,p=0|r._crypto_auth_keybytes();t.length!==p&&f(_,"invalid key length"),h=d(t),_.push(h);var y=!(0|r._crypto_auth_verify(n,c,o,0,h));return g(_),y}function ue(e,a,t){var _=[];l(t),e=E(_,e,"publicKey");var n,s=0|r._crypto_box_publickeybytes();e.length!==s&&f(_,"invalid publicKey length"),n=d(e),_.push(n),a=E(_,a,"privateKey");var c,o=0|r._crypto_box_secretkeybytes();a.length!==o&&f(_,"invalid privateKey length"),c=d(a),_.push(c);var h=new u(0|r._crypto_box_beforenmbytes()),p=h.address;if(_.push(p),!(0|r._crypto_box_beforenm(p,n,c))){var i=y(h,t);return g(_),i}b(_,"invalid usage")}function de(e,a,t){var _=[];l(t),e=E(_,e,"publicKey");var n,s=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();e.length!==s&&f(_,"invalid publicKey length"),n=d(e),_.push(n),a=E(_,a,"privateKey");var c,o=0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes();a.length!==o&&f(_,"invalid privateKey length"),c=d(a),_.push(c);var h=new u(0|r._crypto_box_curve25519xchacha20poly1305_beforenmbytes()),p=h.address;if(_.push(p),!(0|r._crypto_box_curve25519xchacha20poly1305_beforenm(p,n,c))){var i=y(h,t);return g(_),i}b(_,"invalid usage")}function ve(e,a,t,_,n){var s=[];l(n);var c=d(e=E(s,e,"message")),o=e.length;s.push(c),a=E(s,a,"nonce");var h,p=0|r._crypto_box_curve25519xchacha20poly1305_noncebytes();a.length!==p&&f(s,"invalid nonce length"),h=d(a),s.push(h),t=E(s,t,"publicKey");var i,v=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==v&&f(s,"invalid publicKey length"),i=d(t),s.push(i),_=E(s,_,"privateKey");var m,x=0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes();_.length!==x&&f(s,"invalid privateKey length"),m=d(_),s.push(m);var k=new u(0|o),S=k.address;s.push(S);var T=new u(0|r._crypto_box_curve25519xchacha20poly1305_macbytes()),w=T.address;if(s.push(w),!(0|r._crypto_box_curve25519xchacha20poly1305_detached(S,w,c,o,0,h,i,m))){var Y=y({ciphertext:k,mac:T},n);return g(s),Y}b(s,"invalid usage")}function ge(e,a,t,_){var n=[];l(_);var s=d(e=E(n,e,"message")),c=e.length;n.push(s),a=E(n,a,"nonce");var o,h=0|r._crypto_box_curve25519xchacha20poly1305_noncebytes();a.length!==h&&f(n,"invalid nonce length"),o=d(a),n.push(o),t=E(n,t,"sharedKey");var p,i=0|r._crypto_box_curve25519xchacha20poly1305_beforenmbytes();t.length!==i&&f(n,"invalid sharedKey length"),p=d(t),n.push(p);var v=new u(0|c),m=v.address;n.push(m);var x=new u(0|r._crypto_box_curve25519xchacha20poly1305_macbytes()),k=x.address;if(n.push(k),!(0|r._crypto_box_curve25519xchacha20poly1305_detached_afternm(m,k,s,c,0,o,p))){var S=y({ciphertext:v,mac:x},_);return g(n),S}b(n,"invalid usage")}function be(e,a,t,_,n){var s=[];l(n);var c=d(e=E(s,e,"message")),o=e.length;s.push(c),a=E(s,a,"nonce");var h,p=0|r._crypto_box_curve25519xchacha20poly1305_noncebytes();a.length!==p&&f(s,"invalid nonce length"),h=d(a),s.push(h),t=E(s,t,"publicKey");var i,v=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==v&&f(s,"invalid publicKey length"),i=d(t),s.push(i),_=E(s,_,"privateKey");var m,x=0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes();_.length!==x&&f(s,"invalid privateKey length"),m=d(_),s.push(m);var k=new u(o+r._crypto_box_curve25519xchacha20poly1305_macbytes()|0),S=k.address;if(s.push(S),!(0|r._crypto_box_curve25519xchacha20poly1305_easy(S,c,o,0,h,i,m))){var T=y(k,n);return g(s),T}b(s,"invalid usage")}function fe(e,a,t,_){var n=[];l(_);var s=d(e=E(n,e,"message")),c=e.length;n.push(s),a=E(n,a,"nonce");var o,h=0|r._crypto_box_curve25519xchacha20poly1305_noncebytes();a.length!==h&&f(n,"invalid nonce length"),o=d(a),n.push(o),t=E(n,t,"sharedKey");var p,i=0|r._crypto_box_curve25519xchacha20poly1305_beforenmbytes();t.length!==i&&f(n,"invalid sharedKey length"),p=d(t),n.push(p);var v=new u(c+r._crypto_box_curve25519xchacha20poly1305_macbytes()|0),m=v.address;if(n.push(m),!(0|r._crypto_box_curve25519xchacha20poly1305_easy_afternm(m,s,c,0,o,p))){var x=y(v,_);return g(n),x}b(n,"invalid usage")}function me(e){var a=[];l(e);var t=new u(0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes()),_=t.address;a.push(_);var n=new u(0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes()),s=n.address;a.push(s),r._crypto_box_curve25519xchacha20poly1305_keypair(_,s);var c=y({publicKey:t,privateKey:n,keyType:"curve25519"},e);return g(a),c}function Ee(e,a,t,_,n,s){var c=[];l(s);var o=d(e=E(c,e,"ciphertext")),h=e.length;c.push(o),a=E(c,a,"mac");var p,i=0|r._crypto_box_curve25519xchacha20poly1305_macbytes();a.length!==i&&f(c,"invalid mac length"),p=d(a),c.push(p),t=E(c,t,"nonce");var v,m=0|r._crypto_box_curve25519xchacha20poly1305_noncebytes();t.length!==m&&f(c,"invalid nonce length"),v=d(t),c.push(v),_=E(c,_,"publicKey");var x,k=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();_.length!==k&&f(c,"invalid publicKey length"),x=d(_),c.push(x),n=E(c,n,"privateKey");var S,T=0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes();n.length!==T&&f(c,"invalid privateKey length"),S=d(n),c.push(S);var w=new u(0|h),Y=w.address;if(c.push(Y),!(0|r._crypto_box_curve25519xchacha20poly1305_open_detached(Y,o,p,h,0,v,x,S))){var B=y(w,s);return g(c),B}b(c,"incorrect key pair for the given ciphertext")}function xe(e,a,t,_,n){var s=[];l(n);var c=d(e=E(s,e,"ciphertext")),o=e.length;s.push(c),a=E(s,a,"mac");var h,p=0|r._crypto_box_curve25519xchacha20poly1305_macbytes();a.length!==p&&f(s,"invalid mac length"),h=d(a),s.push(h),t=E(s,t,"nonce");var i,v=0|r._crypto_box_curve25519xchacha20poly1305_noncebytes();t.length!==v&&f(s,"invalid nonce length"),i=d(t),s.push(i),_=E(s,_,"sharedKey");var m,x=0|r._crypto_box_curve25519xchacha20poly1305_beforenmbytes();_.length!==x&&f(s,"invalid sharedKey length"),m=d(_),s.push(m);var k=new u(0|o),S=k.address;if(s.push(S),!(0|r._crypto_box_curve25519xchacha20poly1305_open_detached_afternm(S,c,h,o,0,i,m))){var T=y(k,n);return g(s),T}b(s,"incorrect secret key for the given ciphertext")}function ke(e,a,t,_,n){var s=[];l(n),e=E(s,e,"ciphertext");var c,o=r._crypto_box_curve25519xchacha20poly1305_macbytes(),h=e.length;h<o&&f(s,"ciphertext is too short"),c=d(e),s.push(c),a=E(s,a,"nonce");var p,i=0|r._crypto_box_curve25519xchacha20poly1305_noncebytes();a.length!==i&&f(s,"invalid nonce length"),p=d(a),s.push(p),t=E(s,t,"publicKey");var v,m=0|r._crypto_box_curve25519xchacha20poly1305_publickeybytes();t.length!==m&&f(s,"invalid publicKey length"),v=d(t),s.push(v),_=E(s,_,"privateKey");var x,k=0|r._crypto_box_curve25519xchacha20poly1305_secretkeybytes();_.length!==k&&f(s,"invalid privateKey length"),x=d(_),s.push(x);var S=new u(h-r._crypto_box_curve25519xchacha20poly1305_macbytes()|0),T=S.address;if(s.push(T),!(0|r._crypto_box_curve25519xchacha20poly1305_open_easy(T,c,h,0,p,v,x))){var w=y(S,n);return g(s),w}b(s,"incorrect key pair for the given ciphertext")}function Se(e,a,t,_){var n=[];l(_);var s=d(e=E(n,e,"ciphertext")),c=e.length;n.push(s),a=E(n,a,"nonce");var o,h=0|r._crypto_box_curve25519xchacha20poly1305_noncebytes();a.length!==h&&f(n,"invalid nonce length"),o=d(a),n.push(o),t=E(n,t,"sharedKey");var p,i=0|r._crypto_box_curve2