@gurge/sdk-react-native 0.3.82 → 0.3.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/bootstrap.cjs +1 -1
  2. package/bootstrap.mjs +9 -0
  3. package/common/src/API/getCoingeckoPrice.cjs +1 -1
  4. package/common/src/API/proxyAccountsCalls.cjs +1 -1
  5. package/common/src/crypto/EddsaRN.cjs +1 -1
  6. package/common/src/crypto/ecdh-sealed-keys.cjs +1 -1
  7. package/common/src/crypto/ecdh-sealed-keys.mjs +12 -11
  8. package/common/src/crypto/ecdh.cjs +1 -1
  9. package/common/src/crypto/ecdh.mjs +0 -1
  10. package/common/src/crypto/poseidon.cjs +1 -1
  11. package/common/src/crypto/preProcessing.cjs +1 -1
  12. package/common/src/crypto/preProcessing.mjs +13 -12
  13. package/common/src/data-structures/AccountActions/AccountActions.cjs +1 -1
  14. package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
  15. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
  16. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  17. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  18. package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
  19. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  20. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  21. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  22. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  23. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  24. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  25. package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.cjs +1 -1
  26. package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  27. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
  28. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.cjs +1 -1
  29. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
  30. package/common/src/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
  31. package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
  32. package/common/src/data-structures/crypto-keys/keys.cjs +1 -1
  33. package/common/src/data-structures/crypto-keys/keys.mjs +70 -69
  34. package/common/src/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
  35. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  36. package/common/src/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
  37. package/common/src/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
  38. package/common/src/data-structures/http/BasicHttpClient.cjs +1 -1
  39. package/common/src/functions/pre-transaction/convert-okx-instructions.cjs +1 -1
  40. package/common/src/functions/pre-transaction/ensureAmountChanges.cjs +1 -1
  41. package/common/src/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
  42. package/common/src/functions/pre-transaction/sendV0Transaction.cjs +1 -1
  43. package/common/src/functions/pre-transaction/solana.cjs +1 -1
  44. package/common/src/functions/pre-transaction/solanaTransfer.utils.cjs +1 -1
  45. package/common/src/functions/private-wallet/emporium.helpers.cjs +1 -1
  46. package/common/src/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  47. package/common/src/functions/snarkjs/common.snarkjs.cjs +1 -1
  48. package/common/src/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  49. package/common/src/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
  50. package/common/src/functions/snarkjs/signedMessageHash.cjs +1 -1
  51. package/common/src/functions/snarkjs/verifyCommitmentValidationData.cjs +1 -1
  52. package/common/src/functions/utils/abi.utils.cjs +1 -1
  53. package/common/src/functions/utils/addresses.cjs +1 -1
  54. package/common/src/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
  55. package/common/src/functions/utils/create-provider.cjs +1 -1
  56. package/common/src/functions/utils/encryptInputForEnclave.cjs +1 -1
  57. package/common/src/functions/utils/encryptInputForEnclave.mjs +25 -24
  58. package/common/src/functions/utils/external-action.utils.cjs +1 -1
  59. package/common/src/functions/utils/getSignerFromContract.cjs +1 -1
  60. package/common/src/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
  61. package/common/src/functions/utils/mnemonics.cjs +1 -1
  62. package/common/src/functions/utils/publicBalance.utils.cjs +1 -1
  63. package/common/src/functions/utils/solana-memo.cjs +1 -1
  64. package/common/src/functions/utils/solanaMint.utils.cjs +1 -1
  65. package/common/src/functions/utils/tron.utils.cjs +1 -1
  66. package/common/src/functions/utils/userAgent.cjs +1 -1
  67. package/common/src/functions/web3/etherFunctions.cjs +1 -1
  68. package/common/src/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  69. package/common/src/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
  70. package/common/src/functions/web3/events/getShieldedBalance.cjs +1 -1
  71. package/common/src/functions/web3/functionCalls/approveToken.cjs +1 -1
  72. package/common/src/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
  73. package/common/src/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  74. package/common/src/functions/web3/getContractMetadata.cjs +1 -1
  75. package/common/src/functions/web3/okxAPI.cjs +1 -1
  76. package/common/src/functions/web3/uniswapAPI.cjs +1 -1
  77. package/common/src/mutexes/chainBalanceRwLock.cjs +1 -1
  78. package/common/src/mutexes/mutex.cjs +1 -1
  79. package/common/src/providers/EthersProviderAdapter.cjs +1 -1
  80. package/common/src/providers/SolanaProviderAdapter.cjs +1 -1
  81. package/common/src/providers/WagmiProviderAdapter.cjs +1 -1
  82. package/common/src/types/hinkal.types.cjs +1 -1
  83. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
  84. package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
  85. package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
  86. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
  87. package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
  88. package/package.json +5 -1
  89. package/react-native/HinkalProvider.cjs +1 -1
  90. package/react-native/HinkalWebViewWorker.cjs +1 -1
  91. package/react-native/bridge/HinkalRNWorker.cjs +1 -1
  92. package/shims/globals.cjs +11 -0
  93. package/vendor/libsodium/dist/modules/libsodium.cjs +1 -0
  94. package/vendor/libsodium/dist/modules/libsodium.mjs +3711 -0
  95. package/vendor/libsodium-wrappers/dist/modules/libsodium-wrappers.cjs +1 -0
  96. package/vendor/libsodium-wrappers/dist/modules/libsodium-wrappers.mjs +3623 -0
@@ -0,0 +1,3623 @@
1
+ import { __commonJSMin as e } from "../../../../_virtual/_rolldown/runtime.mjs";
2
+ import { require_libsodium as t } from "../../../libsodium/dist/modules/libsodium.mjs";
3
+ //#region node_modules/libsodium-wrappers/dist/modules/libsodium-wrappers.js
4
+ var n = /* @__PURE__ */ e(((e) => {
5
+ (function(n) {
6
+ function r(e, t) {
7
+ var n, r = t.ready.then(function() {
8
+ function r() {
9
+ if (n._sodium_init() < 0) throw Error("libsodium was not correctly initialized.");
10
+ for (var t = /* @__PURE__ */ "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_sha3256.crypto_hash_sha3256_final.crypto_hash_sha3256_init.crypto_hash_sha3256_update.crypto_hash_sha3512.crypto_hash_sha3512_final.crypto_hash_sha3512_init.crypto_hash_sha3512_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_nd_keygen.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_kem_dec.crypto_kem_enc.crypto_kem_keypair.crypto_kem_mlkem768_dec.crypto_kem_mlkem768_enc.crypto_kem_mlkem768_enc_deterministic.crypto_kem_mlkem768_keypair.crypto_kem_mlkem768_seed_keypair.crypto_kem_primitive.crypto_kem_seed_keypair.crypto_kem_xwing_dec.crypto_kem_xwing_enc.crypto_kem_xwing_enc_deterministic.crypto_kem_xwing_keypair.crypto_kem_xwing_seed_keypair.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".split("."), r = [
11
+ S,
12
+ C,
13
+ w,
14
+ T,
15
+ E,
16
+ D,
17
+ O,
18
+ k,
19
+ A,
20
+ ee,
21
+ te,
22
+ j,
23
+ M,
24
+ N,
25
+ P,
26
+ F,
27
+ I,
28
+ L,
29
+ R,
30
+ z,
31
+ B,
32
+ V,
33
+ H,
34
+ U,
35
+ W,
36
+ G,
37
+ K,
38
+ q,
39
+ J,
40
+ Y,
41
+ X,
42
+ Z,
43
+ Q,
44
+ ne,
45
+ re,
46
+ ie,
47
+ ae,
48
+ oe,
49
+ se,
50
+ ce,
51
+ le,
52
+ ue,
53
+ de,
54
+ fe,
55
+ pe,
56
+ me,
57
+ he,
58
+ ge,
59
+ _e,
60
+ ve,
61
+ ye,
62
+ be,
63
+ xe,
64
+ Se,
65
+ Ce,
66
+ we,
67
+ Te,
68
+ Ee,
69
+ De,
70
+ Oe,
71
+ ke,
72
+ Ae,
73
+ je,
74
+ Me,
75
+ Ne,
76
+ Pe,
77
+ Fe,
78
+ Ie,
79
+ Le,
80
+ Re,
81
+ ze,
82
+ Be,
83
+ Ve,
84
+ He,
85
+ Ue,
86
+ We,
87
+ Ge,
88
+ Ke,
89
+ qe,
90
+ Je,
91
+ Ye,
92
+ Xe,
93
+ Ze,
94
+ Qe,
95
+ $e,
96
+ et,
97
+ tt,
98
+ nt,
99
+ rt,
100
+ it,
101
+ at,
102
+ ot,
103
+ st,
104
+ ct,
105
+ lt,
106
+ ut,
107
+ dt,
108
+ ft,
109
+ pt,
110
+ mt,
111
+ ht,
112
+ gt,
113
+ _t,
114
+ vt,
115
+ yt,
116
+ bt,
117
+ xt,
118
+ St,
119
+ Ct,
120
+ wt,
121
+ Tt,
122
+ Et,
123
+ Dt,
124
+ Ot,
125
+ kt,
126
+ At,
127
+ jt,
128
+ Mt,
129
+ Nt,
130
+ Pt,
131
+ Ft,
132
+ It,
133
+ Lt,
134
+ Rt,
135
+ zt,
136
+ Bt,
137
+ Vt,
138
+ Ht,
139
+ Ut,
140
+ Wt,
141
+ Gt,
142
+ Kt,
143
+ qt,
144
+ Jt,
145
+ Yt,
146
+ Xt,
147
+ Zt,
148
+ Qt,
149
+ $t,
150
+ en,
151
+ tn,
152
+ nn,
153
+ rn,
154
+ an,
155
+ on,
156
+ sn,
157
+ cn,
158
+ ln,
159
+ un,
160
+ dn,
161
+ fn,
162
+ pn,
163
+ mn,
164
+ hn,
165
+ gn,
166
+ _n,
167
+ vn,
168
+ yn,
169
+ bn,
170
+ xn,
171
+ Sn,
172
+ Cn,
173
+ wn,
174
+ Tn,
175
+ En,
176
+ Dn,
177
+ On,
178
+ kn,
179
+ An,
180
+ jn,
181
+ Mn,
182
+ Nn,
183
+ Pn,
184
+ Fn,
185
+ In,
186
+ Ln,
187
+ Rn,
188
+ zn,
189
+ Bn,
190
+ Vn,
191
+ Hn,
192
+ Un,
193
+ Wn,
194
+ Gn,
195
+ Kn,
196
+ qn,
197
+ Jn,
198
+ Yn,
199
+ Xn,
200
+ Zn,
201
+ Qn,
202
+ $n,
203
+ er,
204
+ tr,
205
+ nr,
206
+ rr,
207
+ ir,
208
+ ar,
209
+ or,
210
+ sr,
211
+ cr,
212
+ lr,
213
+ ur,
214
+ dr,
215
+ fr,
216
+ pr,
217
+ mr,
218
+ hr,
219
+ gr,
220
+ _r,
221
+ vr,
222
+ yr,
223
+ br,
224
+ xr,
225
+ Sr,
226
+ Cr,
227
+ wr,
228
+ Tr,
229
+ Er,
230
+ Dr,
231
+ Or,
232
+ kr,
233
+ Ar,
234
+ jr,
235
+ Mr,
236
+ $,
237
+ Nr,
238
+ Pr,
239
+ Fr,
240
+ Ir,
241
+ Lr,
242
+ Rr,
243
+ zr,
244
+ Br,
245
+ Vr,
246
+ Hr,
247
+ Ur,
248
+ Wr,
249
+ Gr,
250
+ Kr,
251
+ qr,
252
+ Jr,
253
+ Yr,
254
+ Xr,
255
+ Zr
256
+ ], i = 0; i < r.length; i++) typeof n["_" + t[i]] == "function" && (e[t[i]] = r[i]);
257
+ var a = /* @__PURE__ */ "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_sha3256_BYTES.crypto_hash_sha3512_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_kem_CIPHERTEXTBYTES.crypto_kem_PUBLICKEYBYTES.crypto_kem_SECRETKEYBYTES.crypto_kem_SEEDBYTES.crypto_kem_SHAREDSECRETBYTES.crypto_kem_mlkem768_CIPHERTEXTBYTES.crypto_kem_mlkem768_PUBLICKEYBYTES.crypto_kem_mlkem768_SECRETKEYBYTES.crypto_kem_mlkem768_SEEDBYTES.crypto_kem_mlkem768_SHAREDSECRETBYTES.crypto_kem_xwing_CIPHERTEXTBYTES.crypto_kem_xwing_PUBLICKEYBYTES.crypto_kem_xwing_SECRETKEYBYTES.crypto_kem_xwing_SEEDBYTES.crypto_kem_xwing_SHAREDSECRETBYTES.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".split(".");
258
+ for (i = 0; i < a.length; i++) typeof (s = n["_" + a[i].toLowerCase()]) == "function" && (e[a[i]] = s());
259
+ var o = [
260
+ "SODIUM_VERSION_STRING",
261
+ "crypto_kem_PRIMITIVE",
262
+ "crypto_pwhash_STRPREFIX",
263
+ "crypto_pwhash_argon2i_STRPREFIX",
264
+ "crypto_pwhash_argon2id_STRPREFIX",
265
+ "crypto_pwhash_scryptsalsa208sha256_STRPREFIX"
266
+ ];
267
+ for (i = 0; i < o.length; i++) {
268
+ var s;
269
+ typeof (s = n["_" + o[i].toLowerCase()]) == "function" && (e[o[i]] = n.UTF8ToString(s()));
270
+ }
271
+ }
272
+ n = t;
273
+ try {
274
+ r();
275
+ var i = new Uint8Array([
276
+ 98,
277
+ 97,
278
+ 108,
279
+ 108,
280
+ 115
281
+ ]), a = e.randombytes_buf(e.crypto_secretbox_NONCEBYTES), o = e.randombytes_buf(e.crypto_secretbox_KEYBYTES), s = e.crypto_secretbox_easy(i, a, o), c = e.crypto_secretbox_open_easy(s, a, o);
282
+ if (e.memcmp(i, c)) return;
283
+ } catch (e) {
284
+ if (n.useBackupModule == null) throw Error("Both wasm and asm failed to load" + e);
285
+ }
286
+ return n.useBackupModule().then(function() {
287
+ r();
288
+ });
289
+ });
290
+ function i(e) {
291
+ if (typeof TextEncoder == "function") return new TextEncoder().encode(e);
292
+ e = unescape(encodeURIComponent(e));
293
+ for (var t = new Uint8Array(e.length), n = 0, r = e.length; n < r; n++) t[n] = e.charCodeAt(n);
294
+ return t;
295
+ }
296
+ function a(e) {
297
+ if (typeof TextDecoder == "function") return new TextDecoder("utf-8", { fatal: !0 }).decode(e);
298
+ var t = 8192, n = Math.ceil(e.length / t);
299
+ if (n <= 1) try {
300
+ return decodeURIComponent(escape(String.fromCharCode.apply(null, e)));
301
+ } catch {
302
+ throw TypeError("The encoded data was not valid.");
303
+ }
304
+ for (var r = "", i = 0, o = 0; o < n; o++) {
305
+ var s = Array.prototype.slice.call(e, o * t + i, (o + 1) * t + i);
306
+ if (s.length !== 0) {
307
+ var c, l = s.length, u = 0;
308
+ do {
309
+ var d = s[--l];
310
+ d >= 240 ? (u = 4, c = !0) : d >= 224 ? (u = 3, c = !0) : d >= 192 ? (u = 2, c = !0) : d < 128 && (u = 1, c = !0);
311
+ } while (!c);
312
+ for (var f = u - (s.length - l), p = 0; p < f; p++) i--, s.pop();
313
+ r += a(s);
314
+ }
315
+ }
316
+ return r;
317
+ }
318
+ function o(e) {
319
+ e = x(null, e, "input");
320
+ for (var t, n, r, i = "", a = 0; a < e.length; a++) r = 87 + (n = 15 & e[a]) + (n - 10 >> 8 & -39) << 8 | 87 + (t = e[a] >>> 4) + (t - 10 >> 8 & -39), i += String.fromCharCode(255 & r) + String.fromCharCode(r >>> 8);
321
+ return i;
322
+ }
323
+ var s = {
324
+ ORIGINAL: 1,
325
+ ORIGINAL_NO_PADDING: 3,
326
+ URLSAFE: 5,
327
+ URLSAFE_NO_PADDING: 7
328
+ };
329
+ function c(e) {
330
+ if (e === void 0) return s.URLSAFE_NO_PADDING;
331
+ if (e !== s.ORIGINAL && e !== s.ORIGINAL_NO_PADDING && e !== s.URLSAFE && e !== s.URLSAFE_NO_PADDING) throw Error("unsupported base64 variant");
332
+ return e;
333
+ }
334
+ function l(e, t) {
335
+ t = c(t);
336
+ var r = [];
337
+ e = x(r, e, "input");
338
+ var i, o = 0 | Math.floor(e.length / 3), s = e.length - 3 * o, l = 4 * o + (s === 0 ? 0 : 2 & t ? 2 + (s >>> 1) : 4), u = new p(l + 1), d = m(e);
339
+ return r.push(d), r.push(u.address), n._sodium_bin2base64(u.address, u.length, d, e.length, t) === 0 && v(r, "conversion failed"), u.length = l, i = a(u.to_Uint8Array()), _(r), i;
340
+ }
341
+ function u(e, t) {
342
+ var n = t || "uint8array";
343
+ if (!d(n)) throw Error(n + " output format is not available");
344
+ if (e instanceof p) {
345
+ if (n === "uint8array") return e.to_Uint8Array();
346
+ if (n === "text") return a(e.to_Uint8Array());
347
+ if (n === "hex") return o(e.to_Uint8Array());
348
+ if (n === "base64") return l(e.to_Uint8Array(), s.URLSAFE_NO_PADDING);
349
+ throw Error("What is output format \"" + n + "\"?");
350
+ }
351
+ if (typeof e == "object") {
352
+ for (var r = Object.keys(e), i = {}, c = 0; c < r.length; c++) i[r[c]] = u(e[r[c]], n);
353
+ return i;
354
+ }
355
+ if (typeof e == "string") return e;
356
+ throw TypeError("Cannot format output");
357
+ }
358
+ function d(e) {
359
+ for (var t = [
360
+ "uint8array",
361
+ "text",
362
+ "hex",
363
+ "base64"
364
+ ], n = 0; n < t.length; n++) if (t[n] === e) return !0;
365
+ return !1;
366
+ }
367
+ function f(e) {
368
+ if (e) {
369
+ if (typeof e != "string") throw TypeError("When defined, the output format must be a string");
370
+ if (!d(e)) throw Error(e + " is not a supported output format");
371
+ }
372
+ }
373
+ function p(e) {
374
+ this.length = e, this.address = h(e);
375
+ }
376
+ function m(e) {
377
+ var t = h(e.length);
378
+ return n.HEAPU8.set(e, t), t;
379
+ }
380
+ function h(e) {
381
+ var t = n._malloc(e);
382
+ if (t === 0) throw {
383
+ message: "_malloc() failed",
384
+ length: e
385
+ };
386
+ return t;
387
+ }
388
+ function g(e) {
389
+ n._free(e);
390
+ }
391
+ function _(e) {
392
+ if (e) for (var t = 0; t < e.length; t++) g(e[t]);
393
+ }
394
+ function v(e, t) {
395
+ throw _(e), Error(t);
396
+ }
397
+ function y(e, t) {
398
+ throw _(e), TypeError(t);
399
+ }
400
+ function b(e, t, n) {
401
+ t ?? y(e, n + " cannot be null or undefined");
402
+ }
403
+ function x(e, t, n) {
404
+ return b(e, t, n), t instanceof Uint8Array ? t : typeof t == "string" ? i(t) : void y(e, "unsupported input type for " + n);
405
+ }
406
+ function S(e, t, r, i, a, o) {
407
+ var s = [];
408
+ f(o);
409
+ var c = null;
410
+ e != null && (c = m(e = x(s, e, "secret_nonce")), e.length, s.push(c)), t = x(s, t, "ciphertext");
411
+ var l, d = n._crypto_aead_aegis128l_abytes(), h = t.length;
412
+ h < d && y(s, "ciphertext is too short"), l = m(t), s.push(l);
413
+ var g = null, b = 0;
414
+ r != null && (g = m(r = x(s, r, "additional_data")), b = r.length, s.push(g)), i = x(s, i, "public_nonce");
415
+ var S, C = 0 | n._crypto_aead_aegis128l_npubbytes();
416
+ i.length !== C && y(s, "invalid public_nonce length"), S = m(i), s.push(S), a = x(s, a, "key");
417
+ var w, T = 0 | n._crypto_aead_aegis128l_keybytes();
418
+ a.length !== T && y(s, "invalid key length"), w = m(a), s.push(w);
419
+ var E = new p(h - n._crypto_aead_aegis128l_abytes() | 0), D = E.address;
420
+ if (s.push(D), n._crypto_aead_aegis128l_decrypt(D, null, c, l, h, 0, g, b, 0, S, w) === 0) {
421
+ var O = u(E, o);
422
+ return _(s), O;
423
+ }
424
+ v(s, "ciphertext cannot be decrypted using that key");
425
+ }
426
+ function C(e, t, r, i, a, o, s) {
427
+ var c = [];
428
+ f(s);
429
+ var l = null;
430
+ e != null && (l = m(e = x(c, e, "secret_nonce")), e.length, c.push(l));
431
+ var d = m(t = x(c, t, "ciphertext")), h = t.length;
432
+ c.push(d), r = x(c, r, "mac");
433
+ var g, b = 0 | n._crypto_aead_aegis128l_abytes();
434
+ r.length !== b && y(c, "invalid mac length"), g = m(r), c.push(g);
435
+ var S = null, C = 0;
436
+ i != null && (S = m(i = x(c, i, "additional_data")), C = i.length, c.push(S)), a = x(c, a, "public_nonce");
437
+ var w, T = 0 | n._crypto_aead_aegis128l_npubbytes();
438
+ a.length !== T && y(c, "invalid public_nonce length"), w = m(a), c.push(w), o = x(c, o, "key");
439
+ var E, D = 0 | n._crypto_aead_aegis128l_keybytes();
440
+ o.length !== D && y(c, "invalid key length"), E = m(o), c.push(E);
441
+ var O = new p(0 | h), k = O.address;
442
+ if (c.push(k), n._crypto_aead_aegis128l_decrypt_detached(k, l, d, h, 0, g, S, C, 0, w, E) === 0) {
443
+ var A = u(O, s);
444
+ return _(c), A;
445
+ }
446
+ v(c, "ciphertext cannot be decrypted using that key");
447
+ }
448
+ function w(e, t, r, i, a, o) {
449
+ var s = [];
450
+ f(o);
451
+ var c = m(e = x(s, e, "message")), l = e.length;
452
+ s.push(c);
453
+ var d = null, h = 0;
454
+ t != null && (d = m(t = x(s, t, "additional_data")), h = t.length, s.push(d));
455
+ var g = null;
456
+ r != null && (g = m(r = x(s, r, "secret_nonce")), r.length, s.push(g)), i = x(s, i, "public_nonce");
457
+ var b, S = 0 | n._crypto_aead_aegis128l_npubbytes();
458
+ i.length !== S && y(s, "invalid public_nonce length"), b = m(i), s.push(b), a = x(s, a, "key");
459
+ var C, w = 0 | n._crypto_aead_aegis128l_keybytes();
460
+ a.length !== w && y(s, "invalid key length"), C = m(a), s.push(C);
461
+ var T = new p(l + n._crypto_aead_aegis128l_abytes() | 0), E = T.address;
462
+ if (s.push(E), n._crypto_aead_aegis128l_encrypt(E, null, c, l, 0, d, h, 0, g, b, C) === 0) {
463
+ var D = u(T, o);
464
+ return _(s), D;
465
+ }
466
+ v(s, "invalid usage");
467
+ }
468
+ function T(e, t, r, i, a, o) {
469
+ var s = [];
470
+ f(o);
471
+ var c = m(e = x(s, e, "message")), l = e.length;
472
+ s.push(c);
473
+ var d = null, h = 0;
474
+ t != null && (d = m(t = x(s, t, "additional_data")), h = t.length, s.push(d));
475
+ var g = null;
476
+ r != null && (g = m(r = x(s, r, "secret_nonce")), r.length, s.push(g)), i = x(s, i, "public_nonce");
477
+ var b, S = 0 | n._crypto_aead_aegis128l_npubbytes();
478
+ i.length !== S && y(s, "invalid public_nonce length"), b = m(i), s.push(b), a = x(s, a, "key");
479
+ var C, w = 0 | n._crypto_aead_aegis128l_keybytes();
480
+ a.length !== w && y(s, "invalid key length"), C = m(a), s.push(C);
481
+ var T = new p(0 | l), E = T.address;
482
+ s.push(E);
483
+ var D = new p(0 | n._crypto_aead_aegis128l_abytes()), O = D.address;
484
+ if (s.push(O), n._crypto_aead_aegis128l_encrypt_detached(E, O, null, c, l, 0, d, h, 0, g, b, C) === 0) {
485
+ var k = u({
486
+ ciphertext: T,
487
+ mac: D
488
+ }, o);
489
+ return _(s), k;
490
+ }
491
+ v(s, "invalid usage");
492
+ }
493
+ function E(e) {
494
+ var t = [];
495
+ f(e);
496
+ var r = new p(0 | n._crypto_aead_aegis128l_keybytes()), i = r.address;
497
+ t.push(i), n._crypto_aead_aegis128l_keygen(i);
498
+ var a = u(r, e);
499
+ return _(t), a;
500
+ }
501
+ function D(e, t, r, i, a, o) {
502
+ var s = [];
503
+ f(o);
504
+ var c = null;
505
+ e != null && (c = m(e = x(s, e, "secret_nonce")), e.length, s.push(c)), t = x(s, t, "ciphertext");
506
+ var l, d = n._crypto_aead_aegis256_abytes(), h = t.length;
507
+ h < d && y(s, "ciphertext is too short"), l = m(t), s.push(l);
508
+ var g = null, b = 0;
509
+ r != null && (g = m(r = x(s, r, "additional_data")), b = r.length, s.push(g)), i = x(s, i, "public_nonce");
510
+ var S, C = 0 | n._crypto_aead_aegis256_npubbytes();
511
+ i.length !== C && y(s, "invalid public_nonce length"), S = m(i), s.push(S), a = x(s, a, "key");
512
+ var w, T = 0 | n._crypto_aead_aegis256_keybytes();
513
+ a.length !== T && y(s, "invalid key length"), w = m(a), s.push(w);
514
+ var E = new p(h - n._crypto_aead_aegis256_abytes() | 0), D = E.address;
515
+ if (s.push(D), n._crypto_aead_aegis256_decrypt(D, null, c, l, h, 0, g, b, 0, S, w) === 0) {
516
+ var O = u(E, o);
517
+ return _(s), O;
518
+ }
519
+ v(s, "ciphertext cannot be decrypted using that key");
520
+ }
521
+ function O(e, t, r, i, a, o, s) {
522
+ var c = [];
523
+ f(s);
524
+ var l = null;
525
+ e != null && (l = m(e = x(c, e, "secret_nonce")), e.length, c.push(l));
526
+ var d = m(t = x(c, t, "ciphertext")), h = t.length;
527
+ c.push(d), r = x(c, r, "mac");
528
+ var g, b = 0 | n._crypto_aead_aegis256_abytes();
529
+ r.length !== b && y(c, "invalid mac length"), g = m(r), c.push(g);
530
+ var S = null, C = 0;
531
+ i != null && (S = m(i = x(c, i, "additional_data")), C = i.length, c.push(S)), a = x(c, a, "public_nonce");
532
+ var w, T = 0 | n._crypto_aead_aegis256_npubbytes();
533
+ a.length !== T && y(c, "invalid public_nonce length"), w = m(a), c.push(w), o = x(c, o, "key");
534
+ var E, D = 0 | n._crypto_aead_aegis256_keybytes();
535
+ o.length !== D && y(c, "invalid key length"), E = m(o), c.push(E);
536
+ var O = new p(0 | h), k = O.address;
537
+ if (c.push(k), n._crypto_aead_aegis256_decrypt_detached(k, l, d, h, 0, g, S, C, 0, w, E) === 0) {
538
+ var A = u(O, s);
539
+ return _(c), A;
540
+ }
541
+ v(c, "ciphertext cannot be decrypted using that key");
542
+ }
543
+ function k(e, t, r, i, a, o) {
544
+ var s = [];
545
+ f(o);
546
+ var c = m(e = x(s, e, "message")), l = e.length;
547
+ s.push(c);
548
+ var d = null, h = 0;
549
+ t != null && (d = m(t = x(s, t, "additional_data")), h = t.length, s.push(d));
550
+ var g = null;
551
+ r != null && (g = m(r = x(s, r, "secret_nonce")), r.length, s.push(g)), i = x(s, i, "public_nonce");
552
+ var b, S = 0 | n._crypto_aead_aegis256_npubbytes();
553
+ i.length !== S && y(s, "invalid public_nonce length"), b = m(i), s.push(b), a = x(s, a, "key");
554
+ var C, w = 0 | n._crypto_aead_aegis256_keybytes();
555
+ a.length !== w && y(s, "invalid key length"), C = m(a), s.push(C);
556
+ var T = new p(l + n._crypto_aead_aegis256_abytes() | 0), E = T.address;
557
+ if (s.push(E), n._crypto_aead_aegis256_encrypt(E, null, c, l, 0, d, h, 0, g, b, C) === 0) {
558
+ var D = u(T, o);
559
+ return _(s), D;
560
+ }
561
+ v(s, "invalid usage");
562
+ }
563
+ function A(e, t, r, i, a, o) {
564
+ var s = [];
565
+ f(o);
566
+ var c = m(e = x(s, e, "message")), l = e.length;
567
+ s.push(c);
568
+ var d = null, h = 0;
569
+ t != null && (d = m(t = x(s, t, "additional_data")), h = t.length, s.push(d));
570
+ var g = null;
571
+ r != null && (g = m(r = x(s, r, "secret_nonce")), r.length, s.push(g)), i = x(s, i, "public_nonce");
572
+ var b, S = 0 | n._crypto_aead_aegis256_npubbytes();
573
+ i.length !== S && y(s, "invalid public_nonce length"), b = m(i), s.push(b), a = x(s, a, "key");
574
+ var C, w = 0 | n._crypto_aead_aegis256_keybytes();
575
+ a.length !== w && y(s, "invalid key length"), C = m(a), s.push(C);
576
+ var T = new p(0 | l), E = T.address;
577
+ s.push(E);
578
+ var D = new p(0 | n._crypto_aead_aegis256_abytes()), O = D.address;
579
+ if (s.push(O), n._crypto_aead_aegis256_encrypt_detached(E, O, null, c, l, 0, d, h, 0, g, b, C) === 0) {
580
+ var k = u({
581
+ ciphertext: T,
582
+ mac: D
583
+ }, o);
584
+ return _(s), k;
585
+ }
586
+ v(s, "invalid usage");
587
+ }
588
+ function ee(e) {
589
+ var t = [];
590
+ f(e);
591
+ var r = new p(0 | n._crypto_aead_aegis256_keybytes()), i = r.address;
592
+ t.push(i), n._crypto_aead_aegis256_keygen(i);
593
+ var a = u(r, e);
594
+ return _(t), a;
595
+ }
596
+ function te(e, t, r, i, a, o) {
597
+ var s = [];
598
+ f(o);
599
+ var c = null;
600
+ e != null && (c = m(e = x(s, e, "secret_nonce")), e.length, s.push(c)), t = x(s, t, "ciphertext");
601
+ var l, d = n._crypto_aead_chacha20poly1305_abytes(), h = t.length;
602
+ h < d && y(s, "ciphertext is too short"), l = m(t), s.push(l);
603
+ var g = null, b = 0;
604
+ r != null && (g = m(r = x(s, r, "additional_data")), b = r.length, s.push(g)), i = x(s, i, "public_nonce");
605
+ var S, C = 0 | n._crypto_aead_chacha20poly1305_npubbytes();
606
+ i.length !== C && y(s, "invalid public_nonce length"), S = m(i), s.push(S), a = x(s, a, "key");
607
+ var w, T = 0 | n._crypto_aead_chacha20poly1305_keybytes();
608
+ a.length !== T && y(s, "invalid key length"), w = m(a), s.push(w);
609
+ var E = new p(h - n._crypto_aead_chacha20poly1305_abytes() | 0), D = E.address;
610
+ if (s.push(D), n._crypto_aead_chacha20poly1305_decrypt(D, null, c, l, h, 0, g, b, 0, S, w) === 0) {
611
+ var O = u(E, o);
612
+ return _(s), O;
613
+ }
614
+ v(s, "ciphertext cannot be decrypted using that key");
615
+ }
616
+ function j(e, t, r, i, a, o, s) {
617
+ var c = [];
618
+ f(s);
619
+ var l = null;
620
+ e != null && (l = m(e = x(c, e, "secret_nonce")), e.length, c.push(l));
621
+ var d = m(t = x(c, t, "ciphertext")), h = t.length;
622
+ c.push(d), r = x(c, r, "mac");
623
+ var g, b = 0 | n._crypto_box_macbytes();
624
+ r.length !== b && y(c, "invalid mac length"), g = m(r), c.push(g);
625
+ var S = null, C = 0;
626
+ i != null && (S = m(i = x(c, i, "additional_data")), C = i.length, c.push(S)), a = x(c, a, "public_nonce");
627
+ var w, T = 0 | n._crypto_aead_chacha20poly1305_npubbytes();
628
+ a.length !== T && y(c, "invalid public_nonce length"), w = m(a), c.push(w), o = x(c, o, "key");
629
+ var E, D = 0 | n._crypto_aead_chacha20poly1305_keybytes();
630
+ o.length !== D && y(c, "invalid key length"), E = m(o), c.push(E);
631
+ var O = new p(0 | h), k = O.address;
632
+ if (c.push(k), n._crypto_aead_chacha20poly1305_decrypt_detached(k, l, d, h, 0, g, S, C, 0, w, E) === 0) {
633
+ var A = u(O, s);
634
+ return _(c), A;
635
+ }
636
+ v(c, "ciphertext cannot be decrypted using that key");
637
+ }
638
+ function M(e, t, r, i, a, o) {
639
+ var s = [];
640
+ f(o);
641
+ var c = m(e = x(s, e, "message")), l = e.length;
642
+ s.push(c);
643
+ var d = null, h = 0;
644
+ t != null && (d = m(t = x(s, t, "additional_data")), h = t.length, s.push(d));
645
+ var g = null;
646
+ r != null && (g = m(r = x(s, r, "secret_nonce")), r.length, s.push(g)), i = x(s, i, "public_nonce");
647
+ var b, S = 0 | n._crypto_aead_chacha20poly1305_npubbytes();
648
+ i.length !== S && y(s, "invalid public_nonce length"), b = m(i), s.push(b), a = x(s, a, "key");
649
+ var C, w = 0 | n._crypto_aead_chacha20poly1305_keybytes();
650
+ a.length !== w && y(s, "invalid key length"), C = m(a), s.push(C);
651
+ var T = new p(l + n._crypto_aead_chacha20poly1305_abytes() | 0), E = T.address;
652
+ if (s.push(E), n._crypto_aead_chacha20poly1305_encrypt(E, null, c, l, 0, d, h, 0, g, b, C) === 0) {
653
+ var D = u(T, o);
654
+ return _(s), D;
655
+ }
656
+ v(s, "invalid usage");
657
+ }
658
+ function N(e, t, r, i, a, o) {
659
+ var s = [];
660
+ f(o);
661
+ var c = m(e = x(s, e, "message")), l = e.length;
662
+ s.push(c);
663
+ var d = null, h = 0;
664
+ t != null && (d = m(t = x(s, t, "additional_data")), h = t.length, s.push(d));
665
+ var g = null;
666
+ r != null && (g = m(r = x(s, r, "secret_nonce")), r.length, s.push(g)), i = x(s, i, "public_nonce");
667
+ var b, S = 0 | n._crypto_aead_chacha20poly1305_npubbytes();
668
+ i.length !== S && y(s, "invalid public_nonce length"), b = m(i), s.push(b), a = x(s, a, "key");
669
+ var C, w = 0 | n._crypto_aead_chacha20poly1305_keybytes();
670
+ a.length !== w && y(s, "invalid key length"), C = m(a), s.push(C);
671
+ var T = new p(0 | l), E = T.address;
672
+ s.push(E);
673
+ var D = new p(0 | n._crypto_aead_chacha20poly1305_abytes()), O = D.address;
674
+ if (s.push(O), n._crypto_aead_chacha20poly1305_encrypt_detached(E, O, null, c, l, 0, d, h, 0, g, b, C) === 0) {
675
+ var k = u({
676
+ ciphertext: T,
677
+ mac: D
678
+ }, o);
679
+ return _(s), k;
680
+ }
681
+ v(s, "invalid usage");
682
+ }
683
+ function P(e, t, r, i, a, o) {
684
+ var s = [];
685
+ f(o);
686
+ var c = null;
687
+ e != null && (c = m(e = x(s, e, "secret_nonce")), e.length, s.push(c)), t = x(s, t, "ciphertext");
688
+ var l, d = n._crypto_aead_chacha20poly1305_ietf_abytes(), h = t.length;
689
+ h < d && y(s, "ciphertext is too short"), l = m(t), s.push(l);
690
+ var g = null, b = 0;
691
+ r != null && (g = m(r = x(s, r, "additional_data")), b = r.length, s.push(g)), i = x(s, i, "public_nonce");
692
+ var S, C = 0 | n._crypto_aead_chacha20poly1305_ietf_npubbytes();
693
+ i.length !== C && y(s, "invalid public_nonce length"), S = m(i), s.push(S), a = x(s, a, "key");
694
+ var w, T = 0 | n._crypto_aead_chacha20poly1305_ietf_keybytes();
695
+ a.length !== T && y(s, "invalid key length"), w = m(a), s.push(w);
696
+ var E = new p(h - n._crypto_aead_chacha20poly1305_ietf_abytes() | 0), D = E.address;
697
+ if (s.push(D), n._crypto_aead_chacha20poly1305_ietf_decrypt(D, null, c, l, h, 0, g, b, 0, S, w) === 0) {
698
+ var O = u(E, o);
699
+ return _(s), O;
700
+ }
701
+ v(s, "ciphertext cannot be decrypted using that key");
702
+ }
703
+ function F(e, t, r, i, a, o, s) {
704
+ var c = [];
705
+ f(s);
706
+ var l = null;
707
+ e != null && (l = m(e = x(c, e, "secret_nonce")), e.length, c.push(l));
708
+ var d = m(t = x(c, t, "ciphertext")), h = t.length;
709
+ c.push(d), r = x(c, r, "mac");
710
+ var g, b = 0 | n._crypto_box_macbytes();
711
+ r.length !== b && y(c, "invalid mac length"), g = m(r), c.push(g);
712
+ var S = null, C = 0;
713
+ i != null && (S = m(i = x(c, i, "additional_data")), C = i.length, c.push(S)), a = x(c, a, "public_nonce");
714
+ var w, T = 0 | n._crypto_aead_chacha20poly1305_ietf_npubbytes();
715
+ a.length !== T && y(c, "invalid public_nonce length"), w = m(a), c.push(w), o = x(c, o, "key");
716
+ var E, D = 0 | n._crypto_aead_chacha20poly1305_ietf_keybytes();
717
+ o.length !== D && y(c, "invalid key length"), E = m(o), c.push(E);
718
+ var O = new p(0 | h), k = O.address;
719
+ if (c.push(k), n._crypto_aead_chacha20poly1305_ietf_decrypt_detached(k, l, d, h, 0, g, S, C, 0, w, E) === 0) {
720
+ var A = u(O, s);
721
+ return _(c), A;
722
+ }
723
+ v(c, "ciphertext cannot be decrypted using that key");
724
+ }
725
+ function I(e, t, r, i, a, o) {
726
+ var s = [];
727
+ f(o);
728
+ var c = m(e = x(s, e, "message")), l = e.length;
729
+ s.push(c);
730
+ var d = null, h = 0;
731
+ t != null && (d = m(t = x(s, t, "additional_data")), h = t.length, s.push(d));
732
+ var g = null;
733
+ r != null && (g = m(r = x(s, r, "secret_nonce")), r.length, s.push(g)), i = x(s, i, "public_nonce");
734
+ var b, S = 0 | n._crypto_aead_chacha20poly1305_ietf_npubbytes();
735
+ i.length !== S && y(s, "invalid public_nonce length"), b = m(i), s.push(b), a = x(s, a, "key");
736
+ var C, w = 0 | n._crypto_aead_chacha20poly1305_ietf_keybytes();
737
+ a.length !== w && y(s, "invalid key length"), C = m(a), s.push(C);
738
+ var T = new p(l + n._crypto_aead_chacha20poly1305_ietf_abytes() | 0), E = T.address;
739
+ if (s.push(E), n._crypto_aead_chacha20poly1305_ietf_encrypt(E, null, c, l, 0, d, h, 0, g, b, C) === 0) {
740
+ var D = u(T, o);
741
+ return _(s), D;
742
+ }
743
+ v(s, "invalid usage");
744
+ }
745
+ function L(e, t, r, i, a, o) {
746
+ var s = [];
747
+ f(o);
748
+ var c = m(e = x(s, e, "message")), l = e.length;
749
+ s.push(c);
750
+ var d = null, h = 0;
751
+ t != null && (d = m(t = x(s, t, "additional_data")), h = t.length, s.push(d));
752
+ var g = null;
753
+ r != null && (g = m(r = x(s, r, "secret_nonce")), r.length, s.push(g)), i = x(s, i, "public_nonce");
754
+ var b, S = 0 | n._crypto_aead_chacha20poly1305_ietf_npubbytes();
755
+ i.length !== S && y(s, "invalid public_nonce length"), b = m(i), s.push(b), a = x(s, a, "key");
756
+ var C, w = 0 | n._crypto_aead_chacha20poly1305_ietf_keybytes();
757
+ a.length !== w && y(s, "invalid key length"), C = m(a), s.push(C);
758
+ var T = new p(0 | l), E = T.address;
759
+ s.push(E);
760
+ var D = new p(0 | n._crypto_aead_chacha20poly1305_ietf_abytes()), O = D.address;
761
+ if (s.push(O), n._crypto_aead_chacha20poly1305_ietf_encrypt_detached(E, O, null, c, l, 0, d, h, 0, g, b, C) === 0) {
762
+ var k = u({
763
+ ciphertext: T,
764
+ mac: D
765
+ }, o);
766
+ return _(s), k;
767
+ }
768
+ v(s, "invalid usage");
769
+ }
770
+ function R(e) {
771
+ var t = [];
772
+ f(e);
773
+ var r = new p(0 | n._crypto_aead_chacha20poly1305_ietf_keybytes()), i = r.address;
774
+ t.push(i), n._crypto_aead_chacha20poly1305_ietf_keygen(i);
775
+ var a = u(r, e);
776
+ return _(t), a;
777
+ }
778
+ function z(e) {
779
+ var t = [];
780
+ f(e);
781
+ var r = new p(0 | n._crypto_aead_chacha20poly1305_keybytes()), i = r.address;
782
+ t.push(i), n._crypto_aead_chacha20poly1305_keygen(i);
783
+ var a = u(r, e);
784
+ return _(t), a;
785
+ }
786
+ function B(e, t, r, i, a, o) {
787
+ var s = [];
788
+ f(o);
789
+ var c = null;
790
+ e != null && (c = m(e = x(s, e, "secret_nonce")), e.length, s.push(c)), t = x(s, t, "ciphertext");
791
+ var l, d = n._crypto_aead_xchacha20poly1305_ietf_abytes(), h = t.length;
792
+ h < d && y(s, "ciphertext is too short"), l = m(t), s.push(l);
793
+ var g = null, b = 0;
794
+ r != null && (g = m(r = x(s, r, "additional_data")), b = r.length, s.push(g)), i = x(s, i, "public_nonce");
795
+ var S, C = 0 | n._crypto_aead_xchacha20poly1305_ietf_npubbytes();
796
+ i.length !== C && y(s, "invalid public_nonce length"), S = m(i), s.push(S), a = x(s, a, "key");
797
+ var w, T = 0 | n._crypto_aead_xchacha20poly1305_ietf_keybytes();
798
+ a.length !== T && y(s, "invalid key length"), w = m(a), s.push(w);
799
+ var E = new p(h - n._crypto_aead_xchacha20poly1305_ietf_abytes() | 0), D = E.address;
800
+ if (s.push(D), n._crypto_aead_xchacha20poly1305_ietf_decrypt(D, null, c, l, h, 0, g, b, 0, S, w) === 0) {
801
+ var O = u(E, o);
802
+ return _(s), O;
803
+ }
804
+ v(s, "ciphertext cannot be decrypted using that key");
805
+ }
806
+ function V(e, t, r, i, a, o, s) {
807
+ var c = [];
808
+ f(s);
809
+ var l = null;
810
+ e != null && (l = m(e = x(c, e, "secret_nonce")), e.length, c.push(l));
811
+ var d = m(t = x(c, t, "ciphertext")), h = t.length;
812
+ c.push(d), r = x(c, r, "mac");
813
+ var g, b = 0 | n._crypto_box_macbytes();
814
+ r.length !== b && y(c, "invalid mac length"), g = m(r), c.push(g);
815
+ var S = null, C = 0;
816
+ i != null && (S = m(i = x(c, i, "additional_data")), C = i.length, c.push(S)), a = x(c, a, "public_nonce");
817
+ var w, T = 0 | n._crypto_aead_xchacha20poly1305_ietf_npubbytes();
818
+ a.length !== T && y(c, "invalid public_nonce length"), w = m(a), c.push(w), o = x(c, o, "key");
819
+ var E, D = 0 | n._crypto_aead_xchacha20poly1305_ietf_keybytes();
820
+ o.length !== D && y(c, "invalid key length"), E = m(o), c.push(E);
821
+ var O = new p(0 | h), k = O.address;
822
+ if (c.push(k), n._crypto_aead_xchacha20poly1305_ietf_decrypt_detached(k, l, d, h, 0, g, S, C, 0, w, E) === 0) {
823
+ var A = u(O, s);
824
+ return _(c), A;
825
+ }
826
+ v(c, "ciphertext cannot be decrypted using that key");
827
+ }
828
+ function H(e, t, r, i, a, o) {
829
+ var s = [];
830
+ f(o);
831
+ var c = m(e = x(s, e, "message")), l = e.length;
832
+ s.push(c);
833
+ var d = null, h = 0;
834
+ t != null && (d = m(t = x(s, t, "additional_data")), h = t.length, s.push(d));
835
+ var g = null;
836
+ r != null && (g = m(r = x(s, r, "secret_nonce")), r.length, s.push(g)), i = x(s, i, "public_nonce");
837
+ var b, S = 0 | n._crypto_aead_xchacha20poly1305_ietf_npubbytes();
838
+ i.length !== S && y(s, "invalid public_nonce length"), b = m(i), s.push(b), a = x(s, a, "key");
839
+ var C, w = 0 | n._crypto_aead_xchacha20poly1305_ietf_keybytes();
840
+ a.length !== w && y(s, "invalid key length"), C = m(a), s.push(C);
841
+ var T = new p(l + n._crypto_aead_xchacha20poly1305_ietf_abytes() | 0), E = T.address;
842
+ if (s.push(E), n._crypto_aead_xchacha20poly1305_ietf_encrypt(E, null, c, l, 0, d, h, 0, g, b, C) === 0) {
843
+ var D = u(T, o);
844
+ return _(s), D;
845
+ }
846
+ v(s, "invalid usage");
847
+ }
848
+ function U(e, t, r, i, a, o) {
849
+ var s = [];
850
+ f(o);
851
+ var c = m(e = x(s, e, "message")), l = e.length;
852
+ s.push(c);
853
+ var d = null, h = 0;
854
+ t != null && (d = m(t = x(s, t, "additional_data")), h = t.length, s.push(d));
855
+ var g = null;
856
+ r != null && (g = m(r = x(s, r, "secret_nonce")), r.length, s.push(g)), i = x(s, i, "public_nonce");
857
+ var b, S = 0 | n._crypto_aead_xchacha20poly1305_ietf_npubbytes();
858
+ i.length !== S && y(s, "invalid public_nonce length"), b = m(i), s.push(b), a = x(s, a, "key");
859
+ var C, w = 0 | n._crypto_aead_xchacha20poly1305_ietf_keybytes();
860
+ a.length !== w && y(s, "invalid key length"), C = m(a), s.push(C);
861
+ var T = new p(0 | l), E = T.address;
862
+ s.push(E);
863
+ var D = new p(0 | n._crypto_aead_xchacha20poly1305_ietf_abytes()), O = D.address;
864
+ if (s.push(O), n._crypto_aead_xchacha20poly1305_ietf_encrypt_detached(E, O, null, c, l, 0, d, h, 0, g, b, C) === 0) {
865
+ var k = u({
866
+ ciphertext: T,
867
+ mac: D
868
+ }, o);
869
+ return _(s), k;
870
+ }
871
+ v(s, "invalid usage");
872
+ }
873
+ function W(e) {
874
+ var t = [];
875
+ f(e);
876
+ var r = new p(0 | n._crypto_aead_xchacha20poly1305_ietf_keybytes()), i = r.address;
877
+ t.push(i), n._crypto_aead_xchacha20poly1305_ietf_keygen(i);
878
+ var a = u(r, e);
879
+ return _(t), a;
880
+ }
881
+ function G(e, t, r) {
882
+ var i = [];
883
+ f(r);
884
+ var a = m(e = x(i, e, "message")), o = e.length;
885
+ i.push(a), t = x(i, t, "key");
886
+ var s, c = 0 | n._crypto_auth_keybytes();
887
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
888
+ var l = new p(0 | n._crypto_auth_bytes()), d = l.address;
889
+ if (i.push(d), !(0 | n._crypto_auth(d, a, o, 0, s))) {
890
+ var h = u(l, r);
891
+ return _(i), h;
892
+ }
893
+ v(i, "invalid usage");
894
+ }
895
+ function K(e, t, r) {
896
+ var i = [];
897
+ f(r);
898
+ var a = m(e = x(i, e, "message")), o = e.length;
899
+ i.push(a), t = x(i, t, "key");
900
+ var s, c = 0 | n._crypto_auth_hmacsha256_keybytes();
901
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
902
+ var l = new p(0 | n._crypto_auth_hmacsha256_bytes()), d = l.address;
903
+ if (i.push(d), !(0 | n._crypto_auth_hmacsha256(d, a, o, 0, s))) {
904
+ var h = u(l, r);
905
+ return _(i), h;
906
+ }
907
+ v(i, "invalid usage");
908
+ }
909
+ function q(e, t) {
910
+ var r = [];
911
+ f(t), b(r, e, "state_address");
912
+ var i = new p(0 | n._crypto_auth_hmacsha256_bytes()), a = i.address;
913
+ if (r.push(a), !(0 | n._crypto_auth_hmacsha256_final(e, a))) {
914
+ var o = (n._free(e), u(i, t));
915
+ return _(r), o;
916
+ }
917
+ v(r, "invalid usage");
918
+ }
919
+ function J(e, t) {
920
+ var r = [];
921
+ f(t);
922
+ var i = null, a = 0;
923
+ e != null && (i = m(e = x(r, e, "key")), a = e.length, r.push(i));
924
+ var o = new p(208).address;
925
+ if (!(0 | n._crypto_auth_hmacsha256_init(o, i, a))) {
926
+ var s = o;
927
+ return _(r), s;
928
+ }
929
+ v(r, "invalid usage");
930
+ }
931
+ function Y(e) {
932
+ var t = [];
933
+ f(e);
934
+ var r = new p(0 | n._crypto_auth_hmacsha256_keybytes()), i = r.address;
935
+ t.push(i), n._crypto_auth_hmacsha256_keygen(i);
936
+ var a = u(r, e);
937
+ return _(t), a;
938
+ }
939
+ function X(e, t, r) {
940
+ var i = [];
941
+ f(r), b(i, e, "state_address");
942
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
943
+ i.push(a), 0 | n._crypto_auth_hmacsha256_update(e, a, o) && v(i, "invalid usage"), _(i);
944
+ }
945
+ function Z(e, t, r) {
946
+ var i = [];
947
+ e = x(i, e, "tag");
948
+ var a, o = 0 | n._crypto_auth_hmacsha256_bytes();
949
+ e.length !== o && y(i, "invalid tag length"), a = m(e), i.push(a);
950
+ var s = m(t = x(i, t, "message")), c = t.length;
951
+ i.push(s), r = x(i, r, "key");
952
+ var l, u = 0 | n._crypto_auth_hmacsha256_keybytes();
953
+ r.length !== u && y(i, "invalid key length"), l = m(r), i.push(l);
954
+ var d = !(0 | n._crypto_auth_hmacsha256_verify(a, s, c, 0, l));
955
+ return _(i), d;
956
+ }
957
+ function Q(e, t, r) {
958
+ var i = [];
959
+ f(r);
960
+ var a = m(e = x(i, e, "message")), o = e.length;
961
+ i.push(a), t = x(i, t, "key");
962
+ var s, c = 0 | n._crypto_auth_hmacsha512_keybytes();
963
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
964
+ var l = new p(0 | n._crypto_auth_hmacsha512_bytes()), d = l.address;
965
+ if (i.push(d), !(0 | n._crypto_auth_hmacsha512(d, a, o, 0, s))) {
966
+ var h = u(l, r);
967
+ return _(i), h;
968
+ }
969
+ v(i, "invalid usage");
970
+ }
971
+ function ne(e, t, r) {
972
+ var i = [];
973
+ f(r);
974
+ var a = m(e = x(i, e, "message")), o = e.length;
975
+ i.push(a), t = x(i, t, "key");
976
+ var s, c = 0 | n._crypto_auth_hmacsha512256_keybytes();
977
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
978
+ var l = new p(0 | n._crypto_auth_hmacsha512256_bytes()), d = l.address;
979
+ if (i.push(d), !(0 | n._crypto_auth_hmacsha512256(d, a, o, 0, s))) {
980
+ var h = u(l, r);
981
+ return _(i), h;
982
+ }
983
+ v(i, "invalid usage");
984
+ }
985
+ function re(e, t) {
986
+ var r = [];
987
+ f(t), b(r, e, "state_address");
988
+ var i = new p(0 | n._crypto_auth_hmacsha512256_bytes()), a = i.address;
989
+ if (r.push(a), !(0 | n._crypto_auth_hmacsha512256_final(e, a))) {
990
+ var o = (n._free(e), u(i, t));
991
+ return _(r), o;
992
+ }
993
+ v(r, "invalid usage");
994
+ }
995
+ function ie(e, t) {
996
+ var r = [];
997
+ f(t);
998
+ var i = null, a = 0;
999
+ e != null && (i = m(e = x(r, e, "key")), a = e.length, r.push(i));
1000
+ var o = new p(416).address;
1001
+ if (!(0 | n._crypto_auth_hmacsha512256_init(o, i, a))) {
1002
+ var s = o;
1003
+ return _(r), s;
1004
+ }
1005
+ v(r, "invalid usage");
1006
+ }
1007
+ function ae(e) {
1008
+ var t = [];
1009
+ f(e);
1010
+ var r = new p(0 | n._crypto_auth_hmacsha512256_keybytes()), i = r.address;
1011
+ t.push(i), n._crypto_auth_hmacsha512256_keygen(i);
1012
+ var a = u(r, e);
1013
+ return _(t), a;
1014
+ }
1015
+ function oe(e, t, r) {
1016
+ var i = [];
1017
+ f(r), b(i, e, "state_address");
1018
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
1019
+ i.push(a), 0 | n._crypto_auth_hmacsha512256_update(e, a, o) && v(i, "invalid usage"), _(i);
1020
+ }
1021
+ function se(e, t, r) {
1022
+ var i = [];
1023
+ e = x(i, e, "tag");
1024
+ var a, o = 0 | n._crypto_auth_hmacsha512256_bytes();
1025
+ e.length !== o && y(i, "invalid tag length"), a = m(e), i.push(a);
1026
+ var s = m(t = x(i, t, "message")), c = t.length;
1027
+ i.push(s), r = x(i, r, "key");
1028
+ var l, u = 0 | n._crypto_auth_hmacsha512256_keybytes();
1029
+ r.length !== u && y(i, "invalid key length"), l = m(r), i.push(l);
1030
+ var d = !(0 | n._crypto_auth_hmacsha512256_verify(a, s, c, 0, l));
1031
+ return _(i), d;
1032
+ }
1033
+ function ce(e, t) {
1034
+ var r = [];
1035
+ f(t), b(r, e, "state_address");
1036
+ var i = new p(0 | n._crypto_auth_hmacsha512_bytes()), a = i.address;
1037
+ if (r.push(a), !(0 | n._crypto_auth_hmacsha512_final(e, a))) {
1038
+ var o = (n._free(e), u(i, t));
1039
+ return _(r), o;
1040
+ }
1041
+ v(r, "invalid usage");
1042
+ }
1043
+ function le(e, t) {
1044
+ var r = [];
1045
+ f(t);
1046
+ var i = null, a = 0;
1047
+ e != null && (i = m(e = x(r, e, "key")), a = e.length, r.push(i));
1048
+ var o = new p(416).address;
1049
+ if (!(0 | n._crypto_auth_hmacsha512_init(o, i, a))) {
1050
+ var s = o;
1051
+ return _(r), s;
1052
+ }
1053
+ v(r, "invalid usage");
1054
+ }
1055
+ function ue(e) {
1056
+ var t = [];
1057
+ f(e);
1058
+ var r = new p(0 | n._crypto_auth_hmacsha512_keybytes()), i = r.address;
1059
+ t.push(i), n._crypto_auth_hmacsha512_keygen(i);
1060
+ var a = u(r, e);
1061
+ return _(t), a;
1062
+ }
1063
+ function de(e, t, r) {
1064
+ var i = [];
1065
+ f(r), b(i, e, "state_address");
1066
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
1067
+ i.push(a), 0 | n._crypto_auth_hmacsha512_update(e, a, o) && v(i, "invalid usage"), _(i);
1068
+ }
1069
+ function fe(e, t, r) {
1070
+ var i = [];
1071
+ e = x(i, e, "tag");
1072
+ var a, o = 0 | n._crypto_auth_hmacsha512_bytes();
1073
+ e.length !== o && y(i, "invalid tag length"), a = m(e), i.push(a);
1074
+ var s = m(t = x(i, t, "message")), c = t.length;
1075
+ i.push(s), r = x(i, r, "key");
1076
+ var l, u = 0 | n._crypto_auth_hmacsha512_keybytes();
1077
+ r.length !== u && y(i, "invalid key length"), l = m(r), i.push(l);
1078
+ var d = !(0 | n._crypto_auth_hmacsha512_verify(a, s, c, 0, l));
1079
+ return _(i), d;
1080
+ }
1081
+ function pe(e) {
1082
+ var t = [];
1083
+ f(e);
1084
+ var r = new p(0 | n._crypto_auth_keybytes()), i = r.address;
1085
+ t.push(i), n._crypto_auth_keygen(i);
1086
+ var a = u(r, e);
1087
+ return _(t), a;
1088
+ }
1089
+ function me(e, t, r) {
1090
+ var i = [];
1091
+ e = x(i, e, "tag");
1092
+ var a, o = 0 | n._crypto_auth_bytes();
1093
+ e.length !== o && y(i, "invalid tag length"), a = m(e), i.push(a);
1094
+ var s = m(t = x(i, t, "message")), c = t.length;
1095
+ i.push(s), r = x(i, r, "key");
1096
+ var l, u = 0 | n._crypto_auth_keybytes();
1097
+ r.length !== u && y(i, "invalid key length"), l = m(r), i.push(l);
1098
+ var d = !(0 | n._crypto_auth_verify(a, s, c, 0, l));
1099
+ return _(i), d;
1100
+ }
1101
+ function he(e, t, r) {
1102
+ var i = [];
1103
+ f(r), e = x(i, e, "publicKey");
1104
+ var a, o = 0 | n._crypto_box_publickeybytes();
1105
+ e.length !== o && y(i, "invalid publicKey length"), a = m(e), i.push(a), t = x(i, t, "privateKey");
1106
+ var s, c = 0 | n._crypto_box_secretkeybytes();
1107
+ t.length !== c && y(i, "invalid privateKey length"), s = m(t), i.push(s);
1108
+ var l = new p(0 | n._crypto_box_beforenmbytes()), d = l.address;
1109
+ if (i.push(d), !(0 | n._crypto_box_beforenm(d, a, s))) {
1110
+ var h = u(l, r);
1111
+ return _(i), h;
1112
+ }
1113
+ v(i, "invalid usage");
1114
+ }
1115
+ function ge(e, t, r) {
1116
+ var i = [];
1117
+ f(r), e = x(i, e, "publicKey");
1118
+ var a, o = 0 | n._crypto_box_curve25519xchacha20poly1305_publickeybytes();
1119
+ e.length !== o && y(i, "invalid publicKey length"), a = m(e), i.push(a), t = x(i, t, "privateKey");
1120
+ var s, c = 0 | n._crypto_box_curve25519xchacha20poly1305_secretkeybytes();
1121
+ t.length !== c && y(i, "invalid privateKey length"), s = m(t), i.push(s);
1122
+ var l = new p(0 | n._crypto_box_curve25519xchacha20poly1305_beforenmbytes()), d = l.address;
1123
+ if (i.push(d), !(0 | n._crypto_box_curve25519xchacha20poly1305_beforenm(d, a, s))) {
1124
+ var h = u(l, r);
1125
+ return _(i), h;
1126
+ }
1127
+ v(i, "invalid usage");
1128
+ }
1129
+ function _e(e, t, r, i, a) {
1130
+ var o = [];
1131
+ f(a);
1132
+ var s = m(e = x(o, e, "message")), c = e.length;
1133
+ o.push(s), t = x(o, t, "nonce");
1134
+ var l, d = 0 | n._crypto_box_curve25519xchacha20poly1305_noncebytes();
1135
+ t.length !== d && y(o, "invalid nonce length"), l = m(t), o.push(l), r = x(o, r, "publicKey");
1136
+ var h, g = 0 | n._crypto_box_curve25519xchacha20poly1305_publickeybytes();
1137
+ r.length !== g && y(o, "invalid publicKey length"), h = m(r), o.push(h), i = x(o, i, "privateKey");
1138
+ var b, S = 0 | n._crypto_box_curve25519xchacha20poly1305_secretkeybytes();
1139
+ i.length !== S && y(o, "invalid privateKey length"), b = m(i), o.push(b);
1140
+ var C = new p(0 | c), w = C.address;
1141
+ o.push(w);
1142
+ var T = new p(0 | n._crypto_box_curve25519xchacha20poly1305_macbytes()), E = T.address;
1143
+ if (o.push(E), !(0 | n._crypto_box_curve25519xchacha20poly1305_detached(w, E, s, c, 0, l, h, b))) {
1144
+ var D = u({
1145
+ ciphertext: C,
1146
+ mac: T
1147
+ }, a);
1148
+ return _(o), D;
1149
+ }
1150
+ v(o, "invalid usage");
1151
+ }
1152
+ function ve(e, t, r, i) {
1153
+ var a = [];
1154
+ f(i);
1155
+ var o = m(e = x(a, e, "message")), s = e.length;
1156
+ a.push(o), t = x(a, t, "nonce");
1157
+ var c, l = 0 | n._crypto_box_curve25519xchacha20poly1305_noncebytes();
1158
+ t.length !== l && y(a, "invalid nonce length"), c = m(t), a.push(c), r = x(a, r, "sharedKey");
1159
+ var d, h = 0 | n._crypto_box_curve25519xchacha20poly1305_beforenmbytes();
1160
+ r.length !== h && y(a, "invalid sharedKey length"), d = m(r), a.push(d);
1161
+ var g = new p(0 | s), b = g.address;
1162
+ a.push(b);
1163
+ var S = new p(0 | n._crypto_box_curve25519xchacha20poly1305_macbytes()), C = S.address;
1164
+ if (a.push(C), !(0 | n._crypto_box_curve25519xchacha20poly1305_detached_afternm(b, C, o, s, 0, c, d))) {
1165
+ var w = u({
1166
+ ciphertext: g,
1167
+ mac: S
1168
+ }, i);
1169
+ return _(a), w;
1170
+ }
1171
+ v(a, "invalid usage");
1172
+ }
1173
+ function ye(e, t, r, i, a) {
1174
+ var o = [];
1175
+ f(a);
1176
+ var s = m(e = x(o, e, "message")), c = e.length;
1177
+ o.push(s), t = x(o, t, "nonce");
1178
+ var l, d = 0 | n._crypto_box_curve25519xchacha20poly1305_noncebytes();
1179
+ t.length !== d && y(o, "invalid nonce length"), l = m(t), o.push(l), r = x(o, r, "publicKey");
1180
+ var h, g = 0 | n._crypto_box_curve25519xchacha20poly1305_publickeybytes();
1181
+ r.length !== g && y(o, "invalid publicKey length"), h = m(r), o.push(h), i = x(o, i, "privateKey");
1182
+ var b, S = 0 | n._crypto_box_curve25519xchacha20poly1305_secretkeybytes();
1183
+ i.length !== S && y(o, "invalid privateKey length"), b = m(i), o.push(b);
1184
+ var C = new p(c + n._crypto_box_curve25519xchacha20poly1305_macbytes() | 0), w = C.address;
1185
+ if (o.push(w), !(0 | n._crypto_box_curve25519xchacha20poly1305_easy(w, s, c, 0, l, h, b))) {
1186
+ var T = u(C, a);
1187
+ return _(o), T;
1188
+ }
1189
+ v(o, "invalid usage");
1190
+ }
1191
+ function be(e, t, r, i) {
1192
+ var a = [];
1193
+ f(i);
1194
+ var o = m(e = x(a, e, "message")), s = e.length;
1195
+ a.push(o), t = x(a, t, "nonce");
1196
+ var c, l = 0 | n._crypto_box_curve25519xchacha20poly1305_noncebytes();
1197
+ t.length !== l && y(a, "invalid nonce length"), c = m(t), a.push(c), r = x(a, r, "sharedKey");
1198
+ var d, h = 0 | n._crypto_box_curve25519xchacha20poly1305_beforenmbytes();
1199
+ r.length !== h && y(a, "invalid sharedKey length"), d = m(r), a.push(d);
1200
+ var g = new p(s + n._crypto_box_curve25519xchacha20poly1305_macbytes() | 0), b = g.address;
1201
+ if (a.push(b), !(0 | n._crypto_box_curve25519xchacha20poly1305_easy_afternm(b, o, s, 0, c, d))) {
1202
+ var S = u(g, i);
1203
+ return _(a), S;
1204
+ }
1205
+ v(a, "invalid usage");
1206
+ }
1207
+ function xe(e) {
1208
+ var t = [];
1209
+ f(e);
1210
+ var r = new p(0 | n._crypto_box_curve25519xchacha20poly1305_publickeybytes()), i = r.address;
1211
+ t.push(i);
1212
+ var a = new p(0 | n._crypto_box_curve25519xchacha20poly1305_secretkeybytes()), o = a.address;
1213
+ t.push(o), n._crypto_box_curve25519xchacha20poly1305_keypair(i, o);
1214
+ var s = u({
1215
+ publicKey: r,
1216
+ privateKey: a,
1217
+ keyType: "curve25519"
1218
+ }, e);
1219
+ return _(t), s;
1220
+ }
1221
+ function Se(e, t, r, i, a, o) {
1222
+ var s = [];
1223
+ f(o);
1224
+ var c = m(e = x(s, e, "ciphertext")), l = e.length;
1225
+ s.push(c), t = x(s, t, "mac");
1226
+ var d, h = 0 | n._crypto_box_curve25519xchacha20poly1305_macbytes();
1227
+ t.length !== h && y(s, "invalid mac length"), d = m(t), s.push(d), r = x(s, r, "nonce");
1228
+ var g, b = 0 | n._crypto_box_curve25519xchacha20poly1305_noncebytes();
1229
+ r.length !== b && y(s, "invalid nonce length"), g = m(r), s.push(g), i = x(s, i, "publicKey");
1230
+ var S, C = 0 | n._crypto_box_curve25519xchacha20poly1305_publickeybytes();
1231
+ i.length !== C && y(s, "invalid publicKey length"), S = m(i), s.push(S), a = x(s, a, "privateKey");
1232
+ var w, T = 0 | n._crypto_box_curve25519xchacha20poly1305_secretkeybytes();
1233
+ a.length !== T && y(s, "invalid privateKey length"), w = m(a), s.push(w);
1234
+ var E = new p(0 | l), D = E.address;
1235
+ if (s.push(D), !(0 | n._crypto_box_curve25519xchacha20poly1305_open_detached(D, c, d, l, 0, g, S, w))) {
1236
+ var O = u(E, o);
1237
+ return _(s), O;
1238
+ }
1239
+ v(s, "incorrect key pair for the given ciphertext");
1240
+ }
1241
+ function Ce(e, t, r, i, a) {
1242
+ var o = [];
1243
+ f(a);
1244
+ var s = m(e = x(o, e, "ciphertext")), c = e.length;
1245
+ o.push(s), t = x(o, t, "mac");
1246
+ var l, d = 0 | n._crypto_box_curve25519xchacha20poly1305_macbytes();
1247
+ t.length !== d && y(o, "invalid mac length"), l = m(t), o.push(l), r = x(o, r, "nonce");
1248
+ var h, g = 0 | n._crypto_box_curve25519xchacha20poly1305_noncebytes();
1249
+ r.length !== g && y(o, "invalid nonce length"), h = m(r), o.push(h), i = x(o, i, "sharedKey");
1250
+ var b, S = 0 | n._crypto_box_curve25519xchacha20poly1305_beforenmbytes();
1251
+ i.length !== S && y(o, "invalid sharedKey length"), b = m(i), o.push(b);
1252
+ var C = new p(0 | c), w = C.address;
1253
+ if (o.push(w), !(0 | n._crypto_box_curve25519xchacha20poly1305_open_detached_afternm(w, s, l, c, 0, h, b))) {
1254
+ var T = u(C, a);
1255
+ return _(o), T;
1256
+ }
1257
+ v(o, "incorrect secret key for the given ciphertext");
1258
+ }
1259
+ function we(e, t, r, i, a) {
1260
+ var o = [];
1261
+ f(a), e = x(o, e, "ciphertext");
1262
+ var s, c = n._crypto_box_curve25519xchacha20poly1305_macbytes(), l = e.length;
1263
+ l < c && y(o, "ciphertext is too short"), s = m(e), o.push(s), t = x(o, t, "nonce");
1264
+ var d, h = 0 | n._crypto_box_curve25519xchacha20poly1305_noncebytes();
1265
+ t.length !== h && y(o, "invalid nonce length"), d = m(t), o.push(d), r = x(o, r, "publicKey");
1266
+ var g, b = 0 | n._crypto_box_curve25519xchacha20poly1305_publickeybytes();
1267
+ r.length !== b && y(o, "invalid publicKey length"), g = m(r), o.push(g), i = x(o, i, "privateKey");
1268
+ var S, C = 0 | n._crypto_box_curve25519xchacha20poly1305_secretkeybytes();
1269
+ i.length !== C && y(o, "invalid privateKey length"), S = m(i), o.push(S);
1270
+ var w = new p(l - n._crypto_box_curve25519xchacha20poly1305_macbytes() | 0), T = w.address;
1271
+ if (o.push(T), !(0 | n._crypto_box_curve25519xchacha20poly1305_open_easy(T, s, l, 0, d, g, S))) {
1272
+ var E = u(w, a);
1273
+ return _(o), E;
1274
+ }
1275
+ v(o, "incorrect key pair for the given ciphertext");
1276
+ }
1277
+ function Te(e, t, r, i) {
1278
+ var a = [];
1279
+ f(i);
1280
+ var o = m(e = x(a, e, "ciphertext")), s = e.length;
1281
+ a.push(o), t = x(a, t, "nonce");
1282
+ var c, l = 0 | n._crypto_box_curve25519xchacha20poly1305_noncebytes();
1283
+ t.length !== l && y(a, "invalid nonce length"), c = m(t), a.push(c), r = x(a, r, "sharedKey");
1284
+ var d, h = 0 | n._crypto_box_curve25519xchacha20poly1305_beforenmbytes();
1285
+ r.length !== h && y(a, "invalid sharedKey length"), d = m(r), a.push(d);
1286
+ var g = new p(s - n._crypto_box_curve25519xchacha20poly1305_macbytes() | 0), b = g.address;
1287
+ if (a.push(b), !(0 | n._crypto_box_curve25519xchacha20poly1305_open_easy_afternm(b, o, s, 0, c, d))) {
1288
+ var S = u(g, i);
1289
+ return _(a), S;
1290
+ }
1291
+ v(a, "incorrect secret key for the given ciphertext");
1292
+ }
1293
+ function Ee(e, t, r) {
1294
+ var i = [];
1295
+ f(r);
1296
+ var a = m(e = x(i, e, "message")), o = e.length;
1297
+ i.push(a), t = x(i, t, "publicKey");
1298
+ var s, c = 0 | n._crypto_box_curve25519xchacha20poly1305_publickeybytes();
1299
+ t.length !== c && y(i, "invalid publicKey length"), s = m(t), i.push(s);
1300
+ var l = new p(o + n._crypto_box_curve25519xchacha20poly1305_sealbytes() | 0), d = l.address;
1301
+ i.push(d), n._crypto_box_curve25519xchacha20poly1305_seal(d, a, o, 0, s);
1302
+ var h = u(l, r);
1303
+ return _(i), h;
1304
+ }
1305
+ function De(e, t, r, i) {
1306
+ var a = [];
1307
+ f(i), e = x(a, e, "ciphertext");
1308
+ var o, s = n._crypto_box_curve25519xchacha20poly1305_sealbytes(), c = e.length;
1309
+ c < s && y(a, "ciphertext is too short"), o = m(e), a.push(o), t = x(a, t, "publicKey");
1310
+ var l, d = 0 | n._crypto_box_curve25519xchacha20poly1305_publickeybytes();
1311
+ t.length !== d && y(a, "invalid publicKey length"), l = m(t), a.push(l), r = x(a, r, "secretKey");
1312
+ var h, g = 0 | n._crypto_box_curve25519xchacha20poly1305_secretkeybytes();
1313
+ r.length !== g && y(a, "invalid secretKey length"), h = m(r), a.push(h);
1314
+ var v = new p(c - n._crypto_box_curve25519xchacha20poly1305_sealbytes() | 0), b = v.address;
1315
+ a.push(b), n._crypto_box_curve25519xchacha20poly1305_seal_open(b, o, c, 0, l, h);
1316
+ var S = u(v, i);
1317
+ return _(a), S;
1318
+ }
1319
+ function Oe(e, t) {
1320
+ var r = [];
1321
+ f(t), e = x(r, e, "seed");
1322
+ var i, a = 0 | n._crypto_box_curve25519xchacha20poly1305_seedbytes();
1323
+ e.length !== a && y(r, "invalid seed length"), i = m(e), r.push(i);
1324
+ var o = new p(0 | n._crypto_box_curve25519xchacha20poly1305_publickeybytes()), s = o.address;
1325
+ r.push(s);
1326
+ var c = new p(0 | n._crypto_box_curve25519xchacha20poly1305_secretkeybytes()), l = c.address;
1327
+ if (r.push(l), !(0 | n._crypto_box_curve25519xchacha20poly1305_seed_keypair(s, l, i))) {
1328
+ var d = {
1329
+ publicKey: u(o, t),
1330
+ privateKey: u(c, t),
1331
+ keyType: "x25519"
1332
+ };
1333
+ return _(r), d;
1334
+ }
1335
+ v(r, "invalid usage");
1336
+ }
1337
+ function ke(e, t, r, i, a) {
1338
+ var o = [];
1339
+ f(a);
1340
+ var s = m(e = x(o, e, "message")), c = e.length;
1341
+ o.push(s), t = x(o, t, "nonce");
1342
+ var l, d = 0 | n._crypto_box_noncebytes();
1343
+ t.length !== d && y(o, "invalid nonce length"), l = m(t), o.push(l), r = x(o, r, "publicKey");
1344
+ var h, g = 0 | n._crypto_box_publickeybytes();
1345
+ r.length !== g && y(o, "invalid publicKey length"), h = m(r), o.push(h), i = x(o, i, "privateKey");
1346
+ var b, S = 0 | n._crypto_box_secretkeybytes();
1347
+ i.length !== S && y(o, "invalid privateKey length"), b = m(i), o.push(b);
1348
+ var C = new p(0 | c), w = C.address;
1349
+ o.push(w);
1350
+ var T = new p(0 | n._crypto_box_macbytes()), E = T.address;
1351
+ if (o.push(E), !(0 | n._crypto_box_detached(w, E, s, c, 0, l, h, b))) {
1352
+ var D = u({
1353
+ ciphertext: C,
1354
+ mac: T
1355
+ }, a);
1356
+ return _(o), D;
1357
+ }
1358
+ v(o, "invalid usage");
1359
+ }
1360
+ function Ae(e, t, r, i, a) {
1361
+ var o = [];
1362
+ f(a);
1363
+ var s = m(e = x(o, e, "message")), c = e.length;
1364
+ o.push(s), t = x(o, t, "nonce");
1365
+ var l, d = 0 | n._crypto_box_noncebytes();
1366
+ t.length !== d && y(o, "invalid nonce length"), l = m(t), o.push(l), r = x(o, r, "publicKey");
1367
+ var h, g = 0 | n._crypto_box_publickeybytes();
1368
+ r.length !== g && y(o, "invalid publicKey length"), h = m(r), o.push(h), i = x(o, i, "privateKey");
1369
+ var b, S = 0 | n._crypto_box_secretkeybytes();
1370
+ i.length !== S && y(o, "invalid privateKey length"), b = m(i), o.push(b);
1371
+ var C = new p(c + n._crypto_box_macbytes() | 0), w = C.address;
1372
+ if (o.push(w), !(0 | n._crypto_box_easy(w, s, c, 0, l, h, b))) {
1373
+ var T = u(C, a);
1374
+ return _(o), T;
1375
+ }
1376
+ v(o, "invalid usage");
1377
+ }
1378
+ function je(e, t, r, i) {
1379
+ var a = [];
1380
+ f(i);
1381
+ var o = m(e = x(a, e, "message")), s = e.length;
1382
+ a.push(o), t = x(a, t, "nonce");
1383
+ var c, l = 0 | n._crypto_box_noncebytes();
1384
+ t.length !== l && y(a, "invalid nonce length"), c = m(t), a.push(c), r = x(a, r, "sharedKey");
1385
+ var d, h = 0 | n._crypto_box_beforenmbytes();
1386
+ r.length !== h && y(a, "invalid sharedKey length"), d = m(r), a.push(d);
1387
+ var g = new p(s + n._crypto_box_macbytes() | 0), b = g.address;
1388
+ if (a.push(b), !(0 | n._crypto_box_easy_afternm(b, o, s, 0, c, d))) {
1389
+ var S = u(g, i);
1390
+ return _(a), S;
1391
+ }
1392
+ v(a, "invalid usage");
1393
+ }
1394
+ function Me(e) {
1395
+ var t = [];
1396
+ f(e);
1397
+ var r = new p(0 | n._crypto_box_publickeybytes()), i = r.address;
1398
+ t.push(i);
1399
+ var a = new p(0 | n._crypto_box_secretkeybytes()), o = a.address;
1400
+ if (t.push(o), !(0 | n._crypto_box_keypair(i, o))) {
1401
+ var s = {
1402
+ publicKey: u(r, e),
1403
+ privateKey: u(a, e),
1404
+ keyType: "x25519"
1405
+ };
1406
+ return _(t), s;
1407
+ }
1408
+ v(t, "internal error");
1409
+ }
1410
+ function Ne(e, t, r, i, a, o) {
1411
+ var s = [];
1412
+ f(o);
1413
+ var c = m(e = x(s, e, "ciphertext")), l = e.length;
1414
+ s.push(c), t = x(s, t, "mac");
1415
+ var d, h = 0 | n._crypto_box_macbytes();
1416
+ t.length !== h && y(s, "invalid mac length"), d = m(t), s.push(d), r = x(s, r, "nonce");
1417
+ var g, b = 0 | n._crypto_box_noncebytes();
1418
+ r.length !== b && y(s, "invalid nonce length"), g = m(r), s.push(g), i = x(s, i, "publicKey");
1419
+ var S, C = 0 | n._crypto_box_publickeybytes();
1420
+ i.length !== C && y(s, "invalid publicKey length"), S = m(i), s.push(S), a = x(s, a, "privateKey");
1421
+ var w, T = 0 | n._crypto_box_secretkeybytes();
1422
+ a.length !== T && y(s, "invalid privateKey length"), w = m(a), s.push(w);
1423
+ var E = new p(0 | l), D = E.address;
1424
+ if (s.push(D), !(0 | n._crypto_box_open_detached(D, c, d, l, 0, g, S, w))) {
1425
+ var O = u(E, o);
1426
+ return _(s), O;
1427
+ }
1428
+ v(s, "incorrect key pair for the given ciphertext");
1429
+ }
1430
+ function Pe(e, t, r, i, a) {
1431
+ var o = [];
1432
+ f(a), e = x(o, e, "ciphertext");
1433
+ var s, c = n._crypto_box_macbytes(), l = e.length;
1434
+ l < c && y(o, "ciphertext is too short"), s = m(e), o.push(s), t = x(o, t, "nonce");
1435
+ var d, h = 0 | n._crypto_box_noncebytes();
1436
+ t.length !== h && y(o, "invalid nonce length"), d = m(t), o.push(d), r = x(o, r, "publicKey");
1437
+ var g, b = 0 | n._crypto_box_publickeybytes();
1438
+ r.length !== b && y(o, "invalid publicKey length"), g = m(r), o.push(g), i = x(o, i, "privateKey");
1439
+ var S, C = 0 | n._crypto_box_secretkeybytes();
1440
+ i.length !== C && y(o, "invalid privateKey length"), S = m(i), o.push(S);
1441
+ var w = new p(l - n._crypto_box_macbytes() | 0), T = w.address;
1442
+ if (o.push(T), !(0 | n._crypto_box_open_easy(T, s, l, 0, d, g, S))) {
1443
+ var E = u(w, a);
1444
+ return _(o), E;
1445
+ }
1446
+ v(o, "incorrect key pair for the given ciphertext");
1447
+ }
1448
+ function Fe(e, t, r, i) {
1449
+ var a = [];
1450
+ f(i);
1451
+ var o = m(e = x(a, e, "ciphertext")), s = e.length;
1452
+ a.push(o), t = x(a, t, "nonce");
1453
+ var c, l = 0 | n._crypto_box_noncebytes();
1454
+ t.length !== l && y(a, "invalid nonce length"), c = m(t), a.push(c), r = x(a, r, "sharedKey");
1455
+ var d, h = 0 | n._crypto_box_beforenmbytes();
1456
+ r.length !== h && y(a, "invalid sharedKey length"), d = m(r), a.push(d);
1457
+ var g = new p(s - n._crypto_box_macbytes() | 0), b = g.address;
1458
+ if (a.push(b), !(0 | n._crypto_box_open_easy_afternm(b, o, s, 0, c, d))) {
1459
+ var S = u(g, i);
1460
+ return _(a), S;
1461
+ }
1462
+ v(a, "incorrect secret key for the given ciphertext");
1463
+ }
1464
+ function Ie(e, t, r) {
1465
+ var i = [];
1466
+ f(r);
1467
+ var a = m(e = x(i, e, "message")), o = e.length;
1468
+ i.push(a), t = x(i, t, "publicKey");
1469
+ var s, c = 0 | n._crypto_box_publickeybytes();
1470
+ t.length !== c && y(i, "invalid publicKey length"), s = m(t), i.push(s);
1471
+ var l = new p(o + n._crypto_box_sealbytes() | 0), d = l.address;
1472
+ if (i.push(d), !(0 | n._crypto_box_seal(d, a, o, 0, s))) {
1473
+ var h = u(l, r);
1474
+ return _(i), h;
1475
+ }
1476
+ v(i, "invalid usage");
1477
+ }
1478
+ function Le(e, t, r, i) {
1479
+ var a = [];
1480
+ f(i), e = x(a, e, "ciphertext");
1481
+ var o, s = n._crypto_box_sealbytes(), c = e.length;
1482
+ c < s && y(a, "ciphertext is too short"), o = m(e), a.push(o), t = x(a, t, "publicKey");
1483
+ var l, d = 0 | n._crypto_box_publickeybytes();
1484
+ t.length !== d && y(a, "invalid publicKey length"), l = m(t), a.push(l), r = x(a, r, "privateKey");
1485
+ var h, g = 0 | n._crypto_box_secretkeybytes();
1486
+ r.length !== g && y(a, "invalid privateKey length"), h = m(r), a.push(h);
1487
+ var b = new p(c - n._crypto_box_sealbytes() | 0), S = b.address;
1488
+ if (a.push(S), !(0 | n._crypto_box_seal_open(S, o, c, 0, l, h))) {
1489
+ var C = u(b, i);
1490
+ return _(a), C;
1491
+ }
1492
+ v(a, "incorrect key pair for the given ciphertext");
1493
+ }
1494
+ function Re(e, t) {
1495
+ var r = [];
1496
+ f(t), e = x(r, e, "seed");
1497
+ var i, a = 0 | n._crypto_box_seedbytes();
1498
+ e.length !== a && y(r, "invalid seed length"), i = m(e), r.push(i);
1499
+ var o = new p(0 | n._crypto_box_publickeybytes()), s = o.address;
1500
+ r.push(s);
1501
+ var c = new p(0 | n._crypto_box_secretkeybytes()), l = c.address;
1502
+ if (r.push(l), !(0 | n._crypto_box_seed_keypair(s, l, i))) {
1503
+ var d = {
1504
+ publicKey: u(o, t),
1505
+ privateKey: u(c, t),
1506
+ keyType: "x25519"
1507
+ };
1508
+ return _(r), d;
1509
+ }
1510
+ v(r, "invalid usage");
1511
+ }
1512
+ function ze(e, t, r) {
1513
+ var i = [];
1514
+ f(r), e = x(i, e, "p");
1515
+ var a, o = 0 | n._crypto_core_ed25519_bytes();
1516
+ e.length !== o && y(i, "invalid p length"), a = m(e), i.push(a), t = x(i, t, "q");
1517
+ var s, c = 0 | n._crypto_core_ed25519_bytes();
1518
+ t.length !== c && y(i, "invalid q length"), s = m(t), i.push(s);
1519
+ var l = new p(0 | n._crypto_core_ed25519_bytes()), d = l.address;
1520
+ if (i.push(d), !(0 | n._crypto_core_ed25519_add(d, a, s))) {
1521
+ var h = u(l, r);
1522
+ return _(i), h;
1523
+ }
1524
+ v(i, "input is an invalid element");
1525
+ }
1526
+ function Be(e, t) {
1527
+ var r = [];
1528
+ f(t);
1529
+ var i = m(e = x(r, e, "r"));
1530
+ e.length, r.push(i);
1531
+ var a = new p(0 | n._crypto_core_ed25519_bytes()), o = a.address;
1532
+ if (r.push(o), !(0 | n._crypto_core_ed25519_from_hash(o, i))) {
1533
+ var s = u(a, t);
1534
+ return _(r), s;
1535
+ }
1536
+ v(r, "invalid usage");
1537
+ }
1538
+ function Ve(e, t) {
1539
+ var r = [];
1540
+ f(t);
1541
+ var i = m(e = x(r, e, "r"));
1542
+ e.length, r.push(i);
1543
+ var a = new p(0 | n._crypto_core_ed25519_bytes()), o = a.address;
1544
+ if (r.push(o), !(0 | n._crypto_core_ed25519_from_uniform(o, i))) {
1545
+ var s = u(a, t);
1546
+ return _(r), s;
1547
+ }
1548
+ v(r, "invalid usage");
1549
+ }
1550
+ function He(e, t) {
1551
+ var r = [];
1552
+ f(t), e = x(r, e, "repr");
1553
+ var i, a = 0 | n._crypto_core_ed25519_bytes();
1554
+ e.length !== a && y(r, "invalid repr length"), i = m(e), r.push(i);
1555
+ var o = (0 | n._crypto_core_ed25519_is_valid_point(i)) == 1;
1556
+ return _(r), o;
1557
+ }
1558
+ function Ue(e) {
1559
+ var t = [];
1560
+ f(e);
1561
+ var r = new p(0 | n._crypto_core_ed25519_bytes()), i = r.address;
1562
+ t.push(i), n._crypto_core_ed25519_random(i);
1563
+ var a = u(r, e);
1564
+ return _(t), a;
1565
+ }
1566
+ function We(e, t, r) {
1567
+ var i = [];
1568
+ f(r), e = x(i, e, "x");
1569
+ var a, o = 0 | n._crypto_core_ed25519_scalarbytes();
1570
+ e.length !== o && y(i, "invalid x length"), a = m(e), i.push(a), t = x(i, t, "y");
1571
+ var s, c = 0 | n._crypto_core_ed25519_scalarbytes();
1572
+ t.length !== c && y(i, "invalid y length"), s = m(t), i.push(s);
1573
+ var l = new p(0 | n._crypto_core_ed25519_scalarbytes()), d = l.address;
1574
+ i.push(d), n._crypto_core_ed25519_scalar_add(d, a, s);
1575
+ var h = u(l, r);
1576
+ return _(i), h;
1577
+ }
1578
+ function Ge(e, t) {
1579
+ var r = [];
1580
+ f(t), e = x(r, e, "s");
1581
+ var i, a = 0 | n._crypto_core_ed25519_scalarbytes();
1582
+ e.length !== a && y(r, "invalid s length"), i = m(e), r.push(i);
1583
+ var o = new p(0 | n._crypto_core_ed25519_scalarbytes()), s = o.address;
1584
+ r.push(s), n._crypto_core_ed25519_scalar_complement(s, i);
1585
+ var c = u(o, t);
1586
+ return _(r), c;
1587
+ }
1588
+ function Ke(e, t) {
1589
+ var r = [];
1590
+ f(t), e = x(r, e, "s");
1591
+ var i, a = 0 | n._crypto_core_ed25519_scalarbytes();
1592
+ e.length !== a && y(r, "invalid s length"), i = m(e), r.push(i);
1593
+ var o = new p(0 | n._crypto_core_ed25519_scalarbytes()), s = o.address;
1594
+ if (r.push(s), !(0 | n._crypto_core_ed25519_scalar_invert(s, i))) {
1595
+ var c = u(o, t);
1596
+ return _(r), c;
1597
+ }
1598
+ v(r, "invalid reciprocate");
1599
+ }
1600
+ function qe(e, t, r) {
1601
+ var i = [];
1602
+ f(r), e = x(i, e, "x");
1603
+ var a, o = 0 | n._crypto_core_ed25519_scalarbytes();
1604
+ e.length !== o && y(i, "invalid x length"), a = m(e), i.push(a), t = x(i, t, "y");
1605
+ var s, c = 0 | n._crypto_core_ed25519_scalarbytes();
1606
+ t.length !== c && y(i, "invalid y length"), s = m(t), i.push(s);
1607
+ var l = new p(0 | n._crypto_core_ed25519_scalarbytes()), d = l.address;
1608
+ i.push(d), n._crypto_core_ed25519_scalar_mul(d, a, s);
1609
+ var h = u(l, r);
1610
+ return _(i), h;
1611
+ }
1612
+ function Je(e, t) {
1613
+ var r = [];
1614
+ f(t), e = x(r, e, "s");
1615
+ var i, a = 0 | n._crypto_core_ed25519_scalarbytes();
1616
+ e.length !== a && y(r, "invalid s length"), i = m(e), r.push(i);
1617
+ var o = new p(0 | n._crypto_core_ed25519_scalarbytes()), s = o.address;
1618
+ r.push(s), n._crypto_core_ed25519_scalar_negate(s, i);
1619
+ var c = u(o, t);
1620
+ return _(r), c;
1621
+ }
1622
+ function Ye(e) {
1623
+ var t = [];
1624
+ f(e);
1625
+ var r = new p(0 | n._crypto_core_ed25519_scalarbytes()), i = r.address;
1626
+ t.push(i), n._crypto_core_ed25519_scalar_random(i);
1627
+ var a = u(r, e);
1628
+ return _(t), a;
1629
+ }
1630
+ function Xe(e, t) {
1631
+ var r = [];
1632
+ f(t), e = x(r, e, "sample");
1633
+ var i, a = 0 | n._crypto_core_ed25519_nonreducedscalarbytes();
1634
+ e.length !== a && y(r, "invalid sample length"), i = m(e), r.push(i);
1635
+ var o = new p(0 | n._crypto_core_ed25519_scalarbytes()), s = o.address;
1636
+ r.push(s), n._crypto_core_ed25519_scalar_reduce(s, i);
1637
+ var c = u(o, t);
1638
+ return _(r), c;
1639
+ }
1640
+ function Ze(e, t, r) {
1641
+ var i = [];
1642
+ f(r), e = x(i, e, "x");
1643
+ var a, o = 0 | n._crypto_core_ed25519_scalarbytes();
1644
+ e.length !== o && y(i, "invalid x length"), a = m(e), i.push(a), t = x(i, t, "y");
1645
+ var s, c = 0 | n._crypto_core_ed25519_scalarbytes();
1646
+ t.length !== c && y(i, "invalid y length"), s = m(t), i.push(s);
1647
+ var l = new p(0 | n._crypto_core_ed25519_scalarbytes()), d = l.address;
1648
+ i.push(d), n._crypto_core_ed25519_scalar_sub(d, a, s);
1649
+ var h = u(l, r);
1650
+ return _(i), h;
1651
+ }
1652
+ function Qe(e, t, r) {
1653
+ var i = [];
1654
+ f(r), e = x(i, e, "p");
1655
+ var a, o = 0 | n._crypto_core_ed25519_bytes();
1656
+ e.length !== o && y(i, "invalid p length"), a = m(e), i.push(a), t = x(i, t, "q");
1657
+ var s, c = 0 | n._crypto_core_ed25519_bytes();
1658
+ t.length !== c && y(i, "invalid q length"), s = m(t), i.push(s);
1659
+ var l = new p(0 | n._crypto_core_ed25519_bytes()), d = l.address;
1660
+ if (i.push(d), !(0 | n._crypto_core_ed25519_sub(d, a, s))) {
1661
+ var h = u(l, r);
1662
+ return _(i), h;
1663
+ }
1664
+ v(i, "input is an invalid element");
1665
+ }
1666
+ function $e(e, t, r, i) {
1667
+ var a = [];
1668
+ f(i), e = x(a, e, "input");
1669
+ var o, s = 0 | n._crypto_core_hchacha20_inputbytes();
1670
+ e.length !== s && y(a, "invalid input length"), o = m(e), a.push(o), t = x(a, t, "privateKey");
1671
+ var c, l = 0 | n._crypto_core_hchacha20_keybytes();
1672
+ t.length !== l && y(a, "invalid privateKey length"), c = m(t), a.push(c);
1673
+ var d = null;
1674
+ r != null && (d = m(r = x(a, r, "constant")), r.length, a.push(d));
1675
+ var h = new p(0 | n._crypto_core_hchacha20_outputbytes()), g = h.address;
1676
+ if (a.push(g), !(0 | n._crypto_core_hchacha20(g, o, c, d))) {
1677
+ var b = u(h, i);
1678
+ return _(a), b;
1679
+ }
1680
+ v(a, "invalid usage");
1681
+ }
1682
+ function et(e, t, r, i) {
1683
+ var a = [];
1684
+ f(i), e = x(a, e, "input");
1685
+ var o, s = 0 | n._crypto_core_hsalsa20_inputbytes();
1686
+ e.length !== s && y(a, "invalid input length"), o = m(e), a.push(o), t = x(a, t, "privateKey");
1687
+ var c, l = 0 | n._crypto_core_hsalsa20_keybytes();
1688
+ t.length !== l && y(a, "invalid privateKey length"), c = m(t), a.push(c);
1689
+ var d = null;
1690
+ r != null && (d = m(r = x(a, r, "constant")), r.length, a.push(d));
1691
+ var h = new p(0 | n._crypto_core_hsalsa20_outputbytes()), g = h.address;
1692
+ if (a.push(g), !(0 | n._crypto_core_hsalsa20(g, o, c, d))) {
1693
+ var b = u(h, i);
1694
+ return _(a), b;
1695
+ }
1696
+ v(a, "invalid usage");
1697
+ }
1698
+ function tt(e, t, r) {
1699
+ var i = [];
1700
+ f(r), e = x(i, e, "p");
1701
+ var a, o = 0 | n._crypto_core_ristretto255_bytes();
1702
+ e.length !== o && y(i, "invalid p length"), a = m(e), i.push(a), t = x(i, t, "q");
1703
+ var s, c = 0 | n._crypto_core_ristretto255_bytes();
1704
+ t.length !== c && y(i, "invalid q length"), s = m(t), i.push(s);
1705
+ var l = new p(0 | n._crypto_core_ristretto255_bytes()), d = l.address;
1706
+ if (i.push(d), !(0 | n._crypto_core_ristretto255_add(d, a, s))) {
1707
+ var h = u(l, r);
1708
+ return _(i), h;
1709
+ }
1710
+ v(i, "input is an invalid element");
1711
+ }
1712
+ function nt(e, t) {
1713
+ var r = [];
1714
+ f(t);
1715
+ var i = m(e = x(r, e, "r"));
1716
+ e.length, r.push(i);
1717
+ var a = new p(0 | n._crypto_core_ristretto255_bytes()), o = a.address;
1718
+ if (r.push(o), !(0 | n._crypto_core_ristretto255_from_hash(o, i))) {
1719
+ var s = u(a, t);
1720
+ return _(r), s;
1721
+ }
1722
+ v(r, "invalid usage");
1723
+ }
1724
+ function rt(e, t) {
1725
+ var r = [];
1726
+ f(t), e = x(r, e, "repr");
1727
+ var i, a = 0 | n._crypto_core_ristretto255_bytes();
1728
+ e.length !== a && y(r, "invalid repr length"), i = m(e), r.push(i);
1729
+ var o = (0 | n._crypto_core_ristretto255_is_valid_point(i)) == 1;
1730
+ return _(r), o;
1731
+ }
1732
+ function it(e) {
1733
+ var t = [];
1734
+ f(e);
1735
+ var r = new p(0 | n._crypto_core_ristretto255_bytes()), i = r.address;
1736
+ t.push(i), n._crypto_core_ristretto255_random(i);
1737
+ var a = u(r, e);
1738
+ return _(t), a;
1739
+ }
1740
+ function at(e, t, r) {
1741
+ var i = [];
1742
+ f(r), e = x(i, e, "x");
1743
+ var a, o = 0 | n._crypto_core_ristretto255_scalarbytes();
1744
+ e.length !== o && y(i, "invalid x length"), a = m(e), i.push(a), t = x(i, t, "y");
1745
+ var s, c = 0 | n._crypto_core_ristretto255_scalarbytes();
1746
+ t.length !== c && y(i, "invalid y length"), s = m(t), i.push(s);
1747
+ var l = new p(0 | n._crypto_core_ristretto255_scalarbytes()), d = l.address;
1748
+ i.push(d), n._crypto_core_ristretto255_scalar_add(d, a, s);
1749
+ var h = u(l, r);
1750
+ return _(i), h;
1751
+ }
1752
+ function ot(e, t) {
1753
+ var r = [];
1754
+ f(t), e = x(r, e, "s");
1755
+ var i, a = 0 | n._crypto_core_ristretto255_scalarbytes();
1756
+ e.length !== a && y(r, "invalid s length"), i = m(e), r.push(i);
1757
+ var o = new p(0 | n._crypto_core_ristretto255_scalarbytes()), s = o.address;
1758
+ r.push(s), n._crypto_core_ristretto255_scalar_complement(s, i);
1759
+ var c = u(o, t);
1760
+ return _(r), c;
1761
+ }
1762
+ function st(e, t) {
1763
+ var r = [];
1764
+ f(t), e = x(r, e, "s");
1765
+ var i, a = 0 | n._crypto_core_ristretto255_scalarbytes();
1766
+ e.length !== a && y(r, "invalid s length"), i = m(e), r.push(i);
1767
+ var o = new p(0 | n._crypto_core_ristretto255_scalarbytes()), s = o.address;
1768
+ if (r.push(s), !(0 | n._crypto_core_ristretto255_scalar_invert(s, i))) {
1769
+ var c = u(o, t);
1770
+ return _(r), c;
1771
+ }
1772
+ v(r, "invalid reciprocate");
1773
+ }
1774
+ function ct(e, t, r) {
1775
+ var i = [];
1776
+ f(r), e = x(i, e, "x");
1777
+ var a, o = 0 | n._crypto_core_ristretto255_scalarbytes();
1778
+ e.length !== o && y(i, "invalid x length"), a = m(e), i.push(a), t = x(i, t, "y");
1779
+ var s, c = 0 | n._crypto_core_ristretto255_scalarbytes();
1780
+ t.length !== c && y(i, "invalid y length"), s = m(t), i.push(s);
1781
+ var l = new p(0 | n._crypto_core_ristretto255_scalarbytes()), d = l.address;
1782
+ i.push(d), n._crypto_core_ristretto255_scalar_mul(d, a, s);
1783
+ var h = u(l, r);
1784
+ return _(i), h;
1785
+ }
1786
+ function lt(e, t) {
1787
+ var r = [];
1788
+ f(t), e = x(r, e, "s");
1789
+ var i, a = 0 | n._crypto_core_ristretto255_scalarbytes();
1790
+ e.length !== a && y(r, "invalid s length"), i = m(e), r.push(i);
1791
+ var o = new p(0 | n._crypto_core_ristretto255_scalarbytes()), s = o.address;
1792
+ r.push(s), n._crypto_core_ristretto255_scalar_negate(s, i);
1793
+ var c = u(o, t);
1794
+ return _(r), c;
1795
+ }
1796
+ function ut(e) {
1797
+ var t = [];
1798
+ f(e);
1799
+ var r = new p(0 | n._crypto_core_ristretto255_scalarbytes()), i = r.address;
1800
+ t.push(i), n._crypto_core_ristretto255_scalar_random(i);
1801
+ var a = u(r, e);
1802
+ return _(t), a;
1803
+ }
1804
+ function dt(e, t) {
1805
+ var r = [];
1806
+ f(t), e = x(r, e, "sample");
1807
+ var i, a = 0 | n._crypto_core_ristretto255_nonreducedscalarbytes();
1808
+ e.length !== a && y(r, "invalid sample length"), i = m(e), r.push(i);
1809
+ var o = new p(0 | n._crypto_core_ristretto255_scalarbytes()), s = o.address;
1810
+ r.push(s), n._crypto_core_ristretto255_scalar_reduce(s, i);
1811
+ var c = u(o, t);
1812
+ return _(r), c;
1813
+ }
1814
+ function ft(e, t, r) {
1815
+ var i = [];
1816
+ f(r), e = x(i, e, "x");
1817
+ var a, o = 0 | n._crypto_core_ristretto255_scalarbytes();
1818
+ e.length !== o && y(i, "invalid x length"), a = m(e), i.push(a), t = x(i, t, "y");
1819
+ var s, c = 0 | n._crypto_core_ristretto255_scalarbytes();
1820
+ t.length !== c && y(i, "invalid y length"), s = m(t), i.push(s);
1821
+ var l = new p(0 | n._crypto_core_ristretto255_scalarbytes()), d = l.address;
1822
+ i.push(d), n._crypto_core_ristretto255_scalar_sub(d, a, s);
1823
+ var h = u(l, r);
1824
+ return _(i), h;
1825
+ }
1826
+ function pt(e, t, r) {
1827
+ var i = [];
1828
+ f(r), e = x(i, e, "p");
1829
+ var a, o = 0 | n._crypto_core_ristretto255_bytes();
1830
+ e.length !== o && y(i, "invalid p length"), a = m(e), i.push(a), t = x(i, t, "q");
1831
+ var s, c = 0 | n._crypto_core_ristretto255_bytes();
1832
+ t.length !== c && y(i, "invalid q length"), s = m(t), i.push(s);
1833
+ var l = new p(0 | n._crypto_core_ristretto255_bytes()), d = l.address;
1834
+ if (i.push(d), !(0 | n._crypto_core_ristretto255_sub(d, a, s))) {
1835
+ var h = u(l, r);
1836
+ return _(i), h;
1837
+ }
1838
+ v(i, "input is an invalid element");
1839
+ }
1840
+ function mt(e, t, r, i) {
1841
+ var a = [];
1842
+ f(i), b(a, e, "hash_length"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(a, "hash_length must be an unsigned integer");
1843
+ var o = m(t = x(a, t, "message")), s = t.length;
1844
+ a.push(o);
1845
+ var c = null, l = 0;
1846
+ r != null && (c = m(r = x(a, r, "key")), l = r.length, a.push(c));
1847
+ var d = new p(e |= 0), h = d.address;
1848
+ if (a.push(h), !(0 | n._crypto_generichash(h, e, o, s, 0, c, l))) {
1849
+ var g = u(d, i);
1850
+ return _(a), g;
1851
+ }
1852
+ v(a, "invalid usage");
1853
+ }
1854
+ function ht(e, t, r, i, a) {
1855
+ var o = [];
1856
+ f(a), b(o, e, "subkey_len"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(o, "subkey_len must be an unsigned integer");
1857
+ var s = null, c = 0;
1858
+ t != null && (s = m(t = x(o, t, "key")), c = t.length, o.push(s));
1859
+ var l = null, d = 0;
1860
+ r != null && (r = x(o, r, "id"), d = 0 | n._crypto_generichash_blake2b_saltbytes(), r.length !== d && y(o, "invalid id length"), l = m(r), o.push(l));
1861
+ var h = null, g = 0;
1862
+ i != null && (i = x(o, i, "ctx"), g = 0 | n._crypto_generichash_blake2b_personalbytes(), i.length !== g && y(o, "invalid ctx length"), h = m(i), o.push(h));
1863
+ var S = new p(0 | e), C = S.address;
1864
+ if (o.push(C), !(0 | n._crypto_generichash_blake2b_salt_personal(C, e, null, 0, 0, s, c, l, h))) {
1865
+ var w = u(S, a);
1866
+ return _(o), w;
1867
+ }
1868
+ v(o, "invalid usage");
1869
+ }
1870
+ function gt(e, t, r) {
1871
+ var i = [];
1872
+ f(r), b(i, e, "state_address"), b(i, t, "hash_length"), (typeof t != "number" || (0 | t) !== t || t < 0) && y(i, "hash_length must be an unsigned integer");
1873
+ var a = new p(t |= 0), o = a.address;
1874
+ if (i.push(o), !(0 | n._crypto_generichash_final(e, o, t))) {
1875
+ var s = (n._free(e), u(a, r));
1876
+ return _(i), s;
1877
+ }
1878
+ v(i, "invalid usage");
1879
+ }
1880
+ function _t(e, t, r) {
1881
+ var i = [];
1882
+ f(r);
1883
+ var a = null, o = 0;
1884
+ e != null && (a = m(e = x(i, e, "key")), o = e.length, i.push(a)), b(i, t, "hash_length"), (typeof t != "number" || (0 | t) !== t || t < 0) && y(i, "hash_length must be an unsigned integer");
1885
+ var s = new p(357).address;
1886
+ if (!(0 | n._crypto_generichash_init(s, a, o, t))) {
1887
+ var c = s;
1888
+ return _(i), c;
1889
+ }
1890
+ v(i, "invalid usage");
1891
+ }
1892
+ function vt(e) {
1893
+ var t = [];
1894
+ f(e);
1895
+ var r = new p(0 | n._crypto_generichash_keybytes()), i = r.address;
1896
+ t.push(i), n._crypto_generichash_keygen(i);
1897
+ var a = u(r, e);
1898
+ return _(t), a;
1899
+ }
1900
+ function yt(e, t, r) {
1901
+ var i = [];
1902
+ f(r), b(i, e, "state_address");
1903
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
1904
+ i.push(a), 0 | n._crypto_generichash_update(e, a, o) && v(i, "invalid usage"), _(i);
1905
+ }
1906
+ function bt(e, t) {
1907
+ var r = [];
1908
+ f(t);
1909
+ var i = m(e = x(r, e, "message")), a = e.length;
1910
+ r.push(i);
1911
+ var o = new p(0 | n._crypto_hash_bytes()), s = o.address;
1912
+ if (r.push(s), !(0 | n._crypto_hash(s, i, a, 0))) {
1913
+ var c = u(o, t);
1914
+ return _(r), c;
1915
+ }
1916
+ v(r, "invalid usage");
1917
+ }
1918
+ function xt(e, t) {
1919
+ var r = [];
1920
+ f(t);
1921
+ var i = m(e = x(r, e, "message")), a = e.length;
1922
+ r.push(i);
1923
+ var o = new p(0 | n._crypto_hash_sha256_bytes()), s = o.address;
1924
+ if (r.push(s), !(0 | n._crypto_hash_sha256(s, i, a, 0))) {
1925
+ var c = u(o, t);
1926
+ return _(r), c;
1927
+ }
1928
+ v(r, "invalid usage");
1929
+ }
1930
+ function St(e, t) {
1931
+ var r = [];
1932
+ f(t), b(r, e, "state_address");
1933
+ var i = new p(0 | n._crypto_hash_sha256_bytes()), a = i.address;
1934
+ if (r.push(a), !(0 | n._crypto_hash_sha256_final(e, a))) {
1935
+ var o = (n._free(e), u(i, t));
1936
+ return _(r), o;
1937
+ }
1938
+ v(r, "invalid usage");
1939
+ }
1940
+ function Ct(e) {
1941
+ var t = [];
1942
+ f(e);
1943
+ var r = new p(104).address;
1944
+ if (!(0 | n._crypto_hash_sha256_init(r))) {
1945
+ var i = r;
1946
+ return _(t), i;
1947
+ }
1948
+ v(t, "invalid usage");
1949
+ }
1950
+ function wt(e, t, r) {
1951
+ var i = [];
1952
+ f(r), b(i, e, "state_address");
1953
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
1954
+ i.push(a), 0 | n._crypto_hash_sha256_update(e, a, o) && v(i, "invalid usage"), _(i);
1955
+ }
1956
+ function Tt(e, t) {
1957
+ var r = [];
1958
+ f(t);
1959
+ var i = m(e = x(r, e, "message")), a = e.length;
1960
+ r.push(i);
1961
+ var o = new p(0 | n._crypto_hash_sha3256_bytes()), s = o.address;
1962
+ if (r.push(s), !(0 | n._crypto_hash_sha3256(s, i, a))) {
1963
+ var c = u(o, t);
1964
+ return _(r), c;
1965
+ }
1966
+ v(r, "invalid usage");
1967
+ }
1968
+ function Et(e, t) {
1969
+ var r = [];
1970
+ f(t), b(r, e, "state_address");
1971
+ var i = new p(0 | n._crypto_hash_sha3256_bytes()), a = i.address;
1972
+ if (r.push(a), !(0 | n._crypto_hash_sha3256_final(e, a))) {
1973
+ var o = (n._free(e), u(i, t));
1974
+ return _(r), o;
1975
+ }
1976
+ v(r, "invalid usage");
1977
+ }
1978
+ function Dt(e) {
1979
+ var t = [];
1980
+ f(e);
1981
+ var r = new p(256).address;
1982
+ if (!(0 | n._crypto_hash_sha3256_init(r))) {
1983
+ var i = r;
1984
+ return _(t), i;
1985
+ }
1986
+ v(t, "invalid usage");
1987
+ }
1988
+ function Ot(e, t, r) {
1989
+ var i = [];
1990
+ f(r), b(i, e, "state_address");
1991
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
1992
+ i.push(a), 0 | n._crypto_hash_sha3256_update(e, a, o) && v(i, "invalid usage"), _(i);
1993
+ }
1994
+ function kt(e, t) {
1995
+ var r = [];
1996
+ f(t);
1997
+ var i = m(e = x(r, e, "message")), a = e.length;
1998
+ r.push(i);
1999
+ var o = new p(0 | n._crypto_hash_sha3512_bytes()), s = o.address;
2000
+ if (r.push(s), !(0 | n._crypto_hash_sha3512(s, i, a))) {
2001
+ var c = u(o, t);
2002
+ return _(r), c;
2003
+ }
2004
+ v(r, "invalid usage");
2005
+ }
2006
+ function At(e, t) {
2007
+ var r = [];
2008
+ f(t), b(r, e, "state_address");
2009
+ var i = new p(0 | n._crypto_hash_sha3512_bytes()), a = i.address;
2010
+ if (r.push(a), !(0 | n._crypto_hash_sha3512_final(e, a))) {
2011
+ var o = (n._free(e), u(i, t));
2012
+ return _(r), o;
2013
+ }
2014
+ v(r, "invalid usage");
2015
+ }
2016
+ function jt(e) {
2017
+ var t = [];
2018
+ f(e);
2019
+ var r = new p(256).address;
2020
+ if (!(0 | n._crypto_hash_sha3512_init(r))) {
2021
+ var i = r;
2022
+ return _(t), i;
2023
+ }
2024
+ v(t, "invalid usage");
2025
+ }
2026
+ function Mt(e, t, r) {
2027
+ var i = [];
2028
+ f(r), b(i, e, "state_address");
2029
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
2030
+ i.push(a), 0 | n._crypto_hash_sha3512_update(e, a, o) && v(i, "invalid usage"), _(i);
2031
+ }
2032
+ function Nt(e, t) {
2033
+ var r = [];
2034
+ f(t);
2035
+ var i = m(e = x(r, e, "message")), a = e.length;
2036
+ r.push(i);
2037
+ var o = new p(0 | n._crypto_hash_sha512_bytes()), s = o.address;
2038
+ if (r.push(s), !(0 | n._crypto_hash_sha512(s, i, a, 0))) {
2039
+ var c = u(o, t);
2040
+ return _(r), c;
2041
+ }
2042
+ v(r, "invalid usage");
2043
+ }
2044
+ function Pt(e, t) {
2045
+ var r = [];
2046
+ f(t), b(r, e, "state_address");
2047
+ var i = new p(0 | n._crypto_hash_sha512_bytes()), a = i.address;
2048
+ if (r.push(a), !(0 | n._crypto_hash_sha512_final(e, a))) {
2049
+ var o = (n._free(e), u(i, t));
2050
+ return _(r), o;
2051
+ }
2052
+ v(r, "invalid usage");
2053
+ }
2054
+ function Ft(e) {
2055
+ var t = [];
2056
+ f(e);
2057
+ var r = new p(208).address;
2058
+ if (!(0 | n._crypto_hash_sha512_init(r))) {
2059
+ var i = r;
2060
+ return _(t), i;
2061
+ }
2062
+ v(t, "invalid usage");
2063
+ }
2064
+ function It(e, t, r) {
2065
+ var i = [];
2066
+ f(r), b(i, e, "state_address");
2067
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
2068
+ i.push(a), 0 | n._crypto_hash_sha512_update(e, a, o) && v(i, "invalid usage"), _(i);
2069
+ }
2070
+ function Lt(e, t, r) {
2071
+ var i = [];
2072
+ f(r), e = x(i, e, "input");
2073
+ var a, o = 0 | n._crypto_ipcrypt_bytes();
2074
+ e.length !== o && y(i, "invalid input length"), a = m(e), i.push(a), t = x(i, t, "key");
2075
+ var s, c = 0 | n._crypto_ipcrypt_keybytes();
2076
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
2077
+ var l = new p(0 | n._crypto_ipcrypt_bytes()), d = l.address;
2078
+ i.push(d), n._crypto_ipcrypt_decrypt(d, a, s);
2079
+ var h = u(l, r);
2080
+ return _(i), h;
2081
+ }
2082
+ function Rt(e, t, r) {
2083
+ var i = [];
2084
+ f(r), e = x(i, e, "input");
2085
+ var a, o = 0 | n._crypto_ipcrypt_bytes();
2086
+ e.length !== o && y(i, "invalid input length"), a = m(e), i.push(a), t = x(i, t, "key");
2087
+ var s, c = 0 | n._crypto_ipcrypt_keybytes();
2088
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
2089
+ var l = new p(0 | n._crypto_ipcrypt_bytes()), d = l.address;
2090
+ i.push(d), n._crypto_ipcrypt_encrypt(d, a, s);
2091
+ var h = u(l, r);
2092
+ return _(i), h;
2093
+ }
2094
+ function zt(e) {
2095
+ var t = [];
2096
+ f(e);
2097
+ var r = new p(0 | n._crypto_ipcrypt_keybytes()), i = r.address;
2098
+ t.push(i), n._crypto_ipcrypt_keygen(i);
2099
+ var a = u(r, e);
2100
+ return _(t), a;
2101
+ }
2102
+ function Bt(e, t, r) {
2103
+ var i = [];
2104
+ f(r), e = x(i, e, "input");
2105
+ var a, o = 0 | n._crypto_ipcrypt_nd_outputbytes();
2106
+ e.length !== o && y(i, "invalid input length"), a = m(e), i.push(a), t = x(i, t, "key");
2107
+ var s, c = 0 | n._crypto_ipcrypt_nd_keybytes();
2108
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
2109
+ var l = new p(0 | n._crypto_ipcrypt_nd_inputbytes()), d = l.address;
2110
+ i.push(d), n._crypto_ipcrypt_nd_decrypt(d, a, s);
2111
+ var h = u(l, r);
2112
+ return _(i), h;
2113
+ }
2114
+ function Vt(e, t, r, i) {
2115
+ var a = [];
2116
+ f(i), e = x(a, e, "input");
2117
+ var o, s = 0 | n._crypto_ipcrypt_nd_inputbytes();
2118
+ e.length !== s && y(a, "invalid input length"), o = m(e), a.push(o), t = x(a, t, "tweak");
2119
+ var c, l = 0 | n._crypto_ipcrypt_nd_tweakbytes();
2120
+ t.length !== l && y(a, "invalid tweak length"), c = m(t), a.push(c), r = x(a, r, "key");
2121
+ var d, h = 0 | n._crypto_ipcrypt_nd_keybytes();
2122
+ r.length !== h && y(a, "invalid key length"), d = m(r), a.push(d);
2123
+ var g = new p(0 | n._crypto_ipcrypt_nd_outputbytes()), v = g.address;
2124
+ a.push(v), n._crypto_ipcrypt_nd_encrypt(v, o, c, d);
2125
+ var b = u(g, i);
2126
+ return _(a), b;
2127
+ }
2128
+ function Ht(e) {
2129
+ var t = [];
2130
+ f(e);
2131
+ var r = new p(0 | n._crypto_ipcrypt_nd_keybytes()), i = r.address;
2132
+ t.push(i), n._crypto_ipcrypt_nd_keygen(i);
2133
+ var a = u(r, e);
2134
+ return _(t), a;
2135
+ }
2136
+ function Ut(e, t, r) {
2137
+ var i = [];
2138
+ f(r), e = x(i, e, "input");
2139
+ var a, o = 0 | n._crypto_ipcrypt_ndx_outputbytes();
2140
+ e.length !== o && y(i, "invalid input length"), a = m(e), i.push(a), t = x(i, t, "key");
2141
+ var s, c = 0 | n._crypto_ipcrypt_ndx_keybytes();
2142
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
2143
+ var l = new p(0 | n._crypto_ipcrypt_ndx_inputbytes()), d = l.address;
2144
+ i.push(d), n._crypto_ipcrypt_ndx_decrypt(d, a, s);
2145
+ var h = u(l, r);
2146
+ return _(i), h;
2147
+ }
2148
+ function Wt(e, t, r, i) {
2149
+ var a = [];
2150
+ f(i), e = x(a, e, "input");
2151
+ var o, s = 0 | n._crypto_ipcrypt_ndx_inputbytes();
2152
+ e.length !== s && y(a, "invalid input length"), o = m(e), a.push(o), t = x(a, t, "tweak");
2153
+ var c, l = 0 | n._crypto_ipcrypt_ndx_tweakbytes();
2154
+ t.length !== l && y(a, "invalid tweak length"), c = m(t), a.push(c), r = x(a, r, "key");
2155
+ var d, h = 0 | n._crypto_ipcrypt_ndx_keybytes();
2156
+ r.length !== h && y(a, "invalid key length"), d = m(r), a.push(d);
2157
+ var g = new p(0 | n._crypto_ipcrypt_ndx_outputbytes()), v = g.address;
2158
+ a.push(v), n._crypto_ipcrypt_ndx_encrypt(v, o, c, d);
2159
+ var b = u(g, i);
2160
+ return _(a), b;
2161
+ }
2162
+ function Gt(e) {
2163
+ var t = [];
2164
+ f(e);
2165
+ var r = new p(0 | n._crypto_ipcrypt_ndx_keybytes()), i = r.address;
2166
+ t.push(i), n._crypto_ipcrypt_ndx_keygen(i);
2167
+ var a = u(r, e);
2168
+ return _(t), a;
2169
+ }
2170
+ function Kt(e, t, r) {
2171
+ var i = [];
2172
+ f(r), e = x(i, e, "input");
2173
+ var a, o = 0 | n._crypto_ipcrypt_pfx_bytes();
2174
+ e.length !== o && y(i, "invalid input length"), a = m(e), i.push(a), t = x(i, t, "key");
2175
+ var s, c = 0 | n._crypto_ipcrypt_pfx_keybytes();
2176
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
2177
+ var l = new p(0 | n._crypto_ipcrypt_pfx_bytes()), d = l.address;
2178
+ i.push(d), n._crypto_ipcrypt_pfx_decrypt(d, a, s);
2179
+ var h = u(l, r);
2180
+ return _(i), h;
2181
+ }
2182
+ function qt(e, t, r) {
2183
+ var i = [];
2184
+ f(r), e = x(i, e, "input");
2185
+ var a, o = 0 | n._crypto_ipcrypt_pfx_bytes();
2186
+ e.length !== o && y(i, "invalid input length"), a = m(e), i.push(a), t = x(i, t, "key");
2187
+ var s, c = 0 | n._crypto_ipcrypt_pfx_keybytes();
2188
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
2189
+ var l = new p(0 | n._crypto_ipcrypt_pfx_bytes()), d = l.address;
2190
+ i.push(d), n._crypto_ipcrypt_pfx_encrypt(d, a, s);
2191
+ var h = u(l, r);
2192
+ return _(i), h;
2193
+ }
2194
+ function Jt(e) {
2195
+ var t = [];
2196
+ f(e);
2197
+ var r = new p(0 | n._crypto_ipcrypt_pfx_keybytes()), i = r.address;
2198
+ t.push(i), n._crypto_ipcrypt_pfx_keygen(i);
2199
+ var a = u(r, e);
2200
+ return _(t), a;
2201
+ }
2202
+ function Yt(e, t, r, a, o) {
2203
+ var s = [];
2204
+ f(o), b(s, e, "subkey_len"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(s, "subkey_len must be an unsigned integer"), b(s, t, "subkey_id");
2205
+ var c, l = 0;
2206
+ if (typeof t == "bigint" && t >= BigInt(0)) {
2207
+ let e = t >> BigInt(32);
2208
+ e > BigInt(4294967295) && y(s, "subkey_id cannot be more than 64 bits"), l = Number(e), c = Number(t & BigInt(4294967295));
2209
+ } else typeof t == "number" && (0 | t) === t && t >= 0 ? c = t : y(s, "subkey_id must be an unsigned integer or bigint");
2210
+ typeof r != "string" && y(s, "ctx must be a string"), (r = i(r + "\0")).length - 1 !== n._crypto_kdf_contextbytes() && y(s, "invalid ctx length");
2211
+ var d = m(r);
2212
+ r.length, s.push(d), a = x(s, a, "key");
2213
+ var h, g = 0 | n._crypto_kdf_keybytes();
2214
+ a.length !== g && y(s, "invalid key length"), h = m(a), s.push(h);
2215
+ var v = new p(0 | e), S = v.address;
2216
+ s.push(S), n._crypto_kdf_derive_from_key(S, e, c, l, d, h);
2217
+ var C = u(v, o);
2218
+ return _(s), C;
2219
+ }
2220
+ function Xt(e) {
2221
+ var t = [];
2222
+ f(e);
2223
+ var r = new p(0 | n._crypto_kdf_keybytes()), i = r.address;
2224
+ t.push(i), n._crypto_kdf_keygen(i);
2225
+ var a = u(r, e);
2226
+ return _(t), a;
2227
+ }
2228
+ function Zt(e, t, r) {
2229
+ var i = [];
2230
+ f(r), e = x(i, e, "ciphertext");
2231
+ var a, o = 0 | n._crypto_kem_ciphertextbytes();
2232
+ e.length !== o && y(i, "invalid ciphertext length"), a = m(e), i.push(a), t = x(i, t, "privateKey");
2233
+ var s, c = 0 | n._crypto_kem_secretkeybytes();
2234
+ t.length !== c && y(i, "invalid privateKey length"), s = m(t), i.push(s);
2235
+ var l = new p(0 | n._crypto_kem_sharedsecretbytes()), d = l.address;
2236
+ if (i.push(d), !(0 | n._crypto_kem_dec(d, a, s))) {
2237
+ var h = u(l, r);
2238
+ return _(i), h;
2239
+ }
2240
+ v(i, "invalid usage");
2241
+ }
2242
+ function Qt(e, t) {
2243
+ var r = [];
2244
+ f(t), e = x(r, e, "publicKey");
2245
+ var i, a = 0 | n._crypto_kem_publickeybytes();
2246
+ e.length !== a && y(r, "invalid publicKey length"), i = m(e), r.push(i);
2247
+ var o = new p(0 | n._crypto_kem_ciphertextbytes()), s = o.address;
2248
+ r.push(s);
2249
+ var c = new p(0 | n._crypto_kem_sharedsecretbytes()), l = c.address;
2250
+ if (r.push(l), !(0 | n._crypto_kem_enc(s, l, i))) {
2251
+ var d = u({
2252
+ ciphertext: o,
2253
+ sharedSecret: c
2254
+ }, t);
2255
+ return _(r), d;
2256
+ }
2257
+ v(r, "invalid usage");
2258
+ }
2259
+ function $t(e) {
2260
+ var t = [];
2261
+ f(e);
2262
+ var r = new p(0 | n._crypto_kem_publickeybytes()), i = r.address;
2263
+ t.push(i);
2264
+ var a = new p(0 | n._crypto_kem_secretkeybytes()), o = a.address;
2265
+ if (t.push(o), !(0 | n._crypto_kem_keypair(i, o))) {
2266
+ var s = {
2267
+ publicKey: u(r, e),
2268
+ privateKey: u(a, e),
2269
+ keyType: "xwing"
2270
+ };
2271
+ return _(t), s;
2272
+ }
2273
+ v(t, "internal error");
2274
+ }
2275
+ function en(e, t, r) {
2276
+ var i = [];
2277
+ f(r), e = x(i, e, "ciphertext");
2278
+ var a, o = 0 | n._crypto_kem_mlkem768_ciphertextbytes();
2279
+ e.length !== o && y(i, "invalid ciphertext length"), a = m(e), i.push(a), t = x(i, t, "privateKey");
2280
+ var s, c = 0 | n._crypto_kem_mlkem768_secretkeybytes();
2281
+ t.length !== c && y(i, "invalid privateKey length"), s = m(t), i.push(s);
2282
+ var l = new p(0 | n._crypto_kem_mlkem768_sharedsecretbytes()), d = l.address;
2283
+ if (i.push(d), !(0 | n._crypto_kem_mlkem768_dec(d, a, s))) {
2284
+ var h = u(l, r);
2285
+ return _(i), h;
2286
+ }
2287
+ v(i, "invalid usage");
2288
+ }
2289
+ function tn(e, t) {
2290
+ var r = [];
2291
+ f(t), e = x(r, e, "publicKey");
2292
+ var i, a = 0 | n._crypto_kem_mlkem768_publickeybytes();
2293
+ e.length !== a && y(r, "invalid publicKey length"), i = m(e), r.push(i);
2294
+ var o = new p(0 | n._crypto_kem_mlkem768_ciphertextbytes()), s = o.address;
2295
+ r.push(s);
2296
+ var c = new p(0 | n._crypto_kem_mlkem768_sharedsecretbytes()), l = c.address;
2297
+ if (r.push(l), !(0 | n._crypto_kem_mlkem768_enc(s, l, i))) {
2298
+ var d = u({
2299
+ ciphertext: o,
2300
+ sharedSecret: c
2301
+ }, t);
2302
+ return _(r), d;
2303
+ }
2304
+ v(r, "invalid usage");
2305
+ }
2306
+ function nn(e, t, r) {
2307
+ var i = [];
2308
+ f(r), e = x(i, e, "publicKey");
2309
+ var a, o, s = 0 | n._crypto_kem_mlkem768_publickeybytes();
2310
+ e.length !== s && y(i, "invalid publicKey length"), a = m(e), i.push(a), (t = x(i, t, "seed")).length !== 32 && y(i, "invalid seed length"), o = m(t), i.push(o);
2311
+ var c = new p(0 | n._crypto_kem_mlkem768_ciphertextbytes()), l = c.address;
2312
+ i.push(l);
2313
+ var d = new p(0 | n._crypto_kem_mlkem768_sharedsecretbytes()), h = d.address;
2314
+ if (i.push(h), !(0 | n._crypto_kem_mlkem768_enc_deterministic(l, h, a, o))) {
2315
+ var g = u({
2316
+ ciphertext: c,
2317
+ sharedSecret: d
2318
+ }, r);
2319
+ return _(i), g;
2320
+ }
2321
+ v(i, "invalid usage");
2322
+ }
2323
+ function rn(e) {
2324
+ var t = [];
2325
+ f(e);
2326
+ var r = new p(0 | n._crypto_kem_mlkem768_publickeybytes()), i = r.address;
2327
+ t.push(i);
2328
+ var a = new p(0 | n._crypto_kem_mlkem768_secretkeybytes()), o = a.address;
2329
+ if (t.push(o), !(0 | n._crypto_kem_mlkem768_keypair(i, o))) {
2330
+ var s = {
2331
+ publicKey: u(r, e),
2332
+ privateKey: u(a, e),
2333
+ keyType: "ml-kem-768"
2334
+ };
2335
+ return _(t), s;
2336
+ }
2337
+ v(t, "internal error");
2338
+ }
2339
+ function an(e, t) {
2340
+ var r = [];
2341
+ f(t), e = x(r, e, "seed");
2342
+ var i, a = 0 | n._crypto_kem_mlkem768_seedbytes();
2343
+ e.length !== a && y(r, "invalid seed length"), i = m(e), r.push(i);
2344
+ var o = new p(0 | n._crypto_kem_mlkem768_publickeybytes()), s = o.address;
2345
+ r.push(s);
2346
+ var c = new p(0 | n._crypto_kem_mlkem768_secretkeybytes()), l = c.address;
2347
+ if (r.push(l), !(0 | n._crypto_kem_mlkem768_seed_keypair(s, l, i))) {
2348
+ var d = {
2349
+ publicKey: u(o, t),
2350
+ privateKey: u(c, t),
2351
+ keyType: "ml-kem-768"
2352
+ };
2353
+ return _(r), d;
2354
+ }
2355
+ v(r, "invalid usage");
2356
+ }
2357
+ function on() {
2358
+ var e = n._crypto_kem_primitive(), t = n.UTF8ToString(e);
2359
+ return _([]), t;
2360
+ }
2361
+ function sn(e, t) {
2362
+ var r = [];
2363
+ f(t), e = x(r, e, "seed");
2364
+ var i, a = 0 | n._crypto_kem_seedbytes();
2365
+ e.length !== a && y(r, "invalid seed length"), i = m(e), r.push(i);
2366
+ var o = new p(0 | n._crypto_kem_publickeybytes()), s = o.address;
2367
+ r.push(s);
2368
+ var c = new p(0 | n._crypto_kem_secretkeybytes()), l = c.address;
2369
+ if (r.push(l), !(0 | n._crypto_kem_seed_keypair(s, l, i))) {
2370
+ var d = {
2371
+ publicKey: u(o, t),
2372
+ privateKey: u(c, t),
2373
+ keyType: "xwing"
2374
+ };
2375
+ return _(r), d;
2376
+ }
2377
+ v(r, "invalid usage");
2378
+ }
2379
+ function cn(e, t, r) {
2380
+ var i = [];
2381
+ f(r), e = x(i, e, "ciphertext");
2382
+ var a, o = 0 | n._crypto_kem_xwing_ciphertextbytes();
2383
+ e.length !== o && y(i, "invalid ciphertext length"), a = m(e), i.push(a), t = x(i, t, "privateKey");
2384
+ var s, c = 0 | n._crypto_kem_xwing_secretkeybytes();
2385
+ t.length !== c && y(i, "invalid privateKey length"), s = m(t), i.push(s);
2386
+ var l = new p(0 | n._crypto_kem_xwing_sharedsecretbytes()), d = l.address;
2387
+ if (i.push(d), !(0 | n._crypto_kem_xwing_dec(d, a, s))) {
2388
+ var h = u(l, r);
2389
+ return _(i), h;
2390
+ }
2391
+ v(i, "invalid usage");
2392
+ }
2393
+ function ln(e, t) {
2394
+ var r = [];
2395
+ f(t), e = x(r, e, "publicKey");
2396
+ var i, a = 0 | n._crypto_kem_xwing_publickeybytes();
2397
+ e.length !== a && y(r, "invalid publicKey length"), i = m(e), r.push(i);
2398
+ var o = new p(0 | n._crypto_kem_xwing_ciphertextbytes()), s = o.address;
2399
+ r.push(s);
2400
+ var c = new p(0 | n._crypto_kem_xwing_sharedsecretbytes()), l = c.address;
2401
+ if (r.push(l), !(0 | n._crypto_kem_xwing_enc(s, l, i))) {
2402
+ var d = u({
2403
+ ciphertext: o,
2404
+ sharedSecret: c
2405
+ }, t);
2406
+ return _(r), d;
2407
+ }
2408
+ v(r, "invalid usage");
2409
+ }
2410
+ function un(e, t, r) {
2411
+ var i = [];
2412
+ f(r), e = x(i, e, "publicKey");
2413
+ var a, o, s = 0 | n._crypto_kem_xwing_publickeybytes();
2414
+ e.length !== s && y(i, "invalid publicKey length"), a = m(e), i.push(a), (t = x(i, t, "seed")).length !== 64 && y(i, "invalid seed length"), o = m(t), i.push(o);
2415
+ var c = new p(0 | n._crypto_kem_xwing_ciphertextbytes()), l = c.address;
2416
+ i.push(l);
2417
+ var d = new p(0 | n._crypto_kem_xwing_sharedsecretbytes()), h = d.address;
2418
+ if (i.push(h), !(0 | n._crypto_kem_xwing_enc_deterministic(l, h, a, o))) {
2419
+ var g = u({
2420
+ ciphertext: c,
2421
+ sharedSecret: d
2422
+ }, r);
2423
+ return _(i), g;
2424
+ }
2425
+ v(i, "invalid usage");
2426
+ }
2427
+ function dn(e) {
2428
+ var t = [];
2429
+ f(e);
2430
+ var r = new p(0 | n._crypto_kem_xwing_publickeybytes()), i = r.address;
2431
+ t.push(i);
2432
+ var a = new p(0 | n._crypto_kem_xwing_secretkeybytes()), o = a.address;
2433
+ if (t.push(o), !(0 | n._crypto_kem_xwing_keypair(i, o))) {
2434
+ var s = {
2435
+ publicKey: u(r, e),
2436
+ privateKey: u(a, e),
2437
+ keyType: "xwing"
2438
+ };
2439
+ return _(t), s;
2440
+ }
2441
+ v(t, "internal error");
2442
+ }
2443
+ function fn(e, t) {
2444
+ var r = [];
2445
+ f(t), e = x(r, e, "seed");
2446
+ var i, a = 0 | n._crypto_kem_xwing_seedbytes();
2447
+ e.length !== a && y(r, "invalid seed length"), i = m(e), r.push(i);
2448
+ var o = new p(0 | n._crypto_kem_xwing_publickeybytes()), s = o.address;
2449
+ r.push(s);
2450
+ var c = new p(0 | n._crypto_kem_xwing_secretkeybytes()), l = c.address;
2451
+ if (r.push(l), !(0 | n._crypto_kem_xwing_seed_keypair(s, l, i))) {
2452
+ var d = {
2453
+ publicKey: u(o, t),
2454
+ privateKey: u(c, t),
2455
+ keyType: "xwing"
2456
+ };
2457
+ return _(r), d;
2458
+ }
2459
+ v(r, "invalid usage");
2460
+ }
2461
+ function pn(e, t, r, i) {
2462
+ var a = [];
2463
+ f(i), e = x(a, e, "clientPublicKey");
2464
+ var o, s = 0 | n._crypto_kx_publickeybytes();
2465
+ e.length !== s && y(a, "invalid clientPublicKey length"), o = m(e), a.push(o), t = x(a, t, "clientSecretKey");
2466
+ var c, l = 0 | n._crypto_kx_secretkeybytes();
2467
+ t.length !== l && y(a, "invalid clientSecretKey length"), c = m(t), a.push(c), r = x(a, r, "serverPublicKey");
2468
+ var d, h = 0 | n._crypto_kx_publickeybytes();
2469
+ r.length !== h && y(a, "invalid serverPublicKey length"), d = m(r), a.push(d);
2470
+ var g = new p(0 | n._crypto_kx_sessionkeybytes()), b = g.address;
2471
+ a.push(b);
2472
+ var S = new p(0 | n._crypto_kx_sessionkeybytes()), C = S.address;
2473
+ if (a.push(C), !(0 | n._crypto_kx_client_session_keys(b, C, o, c, d))) {
2474
+ var w = u({
2475
+ sharedRx: g,
2476
+ sharedTx: S
2477
+ }, i);
2478
+ return _(a), w;
2479
+ }
2480
+ v(a, "invalid usage");
2481
+ }
2482
+ function mn(e) {
2483
+ var t = [];
2484
+ f(e);
2485
+ var r = new p(0 | n._crypto_kx_publickeybytes()), i = r.address;
2486
+ t.push(i);
2487
+ var a = new p(0 | n._crypto_kx_secretkeybytes()), o = a.address;
2488
+ if (t.push(o), !(0 | n._crypto_kx_keypair(i, o))) {
2489
+ var s = {
2490
+ publicKey: u(r, e),
2491
+ privateKey: u(a, e),
2492
+ keyType: "x25519"
2493
+ };
2494
+ return _(t), s;
2495
+ }
2496
+ v(t, "internal error");
2497
+ }
2498
+ function hn(e, t) {
2499
+ var r = [];
2500
+ f(t), e = x(r, e, "seed");
2501
+ var i, a = 0 | n._crypto_kx_seedbytes();
2502
+ e.length !== a && y(r, "invalid seed length"), i = m(e), r.push(i);
2503
+ var o = new p(0 | n._crypto_kx_publickeybytes()), s = o.address;
2504
+ r.push(s);
2505
+ var c = new p(0 | n._crypto_kx_secretkeybytes()), l = c.address;
2506
+ if (r.push(l), !(0 | n._crypto_kx_seed_keypair(s, l, i))) {
2507
+ var d = {
2508
+ publicKey: u(o, t),
2509
+ privateKey: u(c, t),
2510
+ keyType: "x25519"
2511
+ };
2512
+ return _(r), d;
2513
+ }
2514
+ v(r, "internal error");
2515
+ }
2516
+ function gn(e, t, r, i) {
2517
+ var a = [];
2518
+ f(i), e = x(a, e, "serverPublicKey");
2519
+ var o, s = 0 | n._crypto_kx_publickeybytes();
2520
+ e.length !== s && y(a, "invalid serverPublicKey length"), o = m(e), a.push(o), t = x(a, t, "serverSecretKey");
2521
+ var c, l = 0 | n._crypto_kx_secretkeybytes();
2522
+ t.length !== l && y(a, "invalid serverSecretKey length"), c = m(t), a.push(c), r = x(a, r, "clientPublicKey");
2523
+ var d, h = 0 | n._crypto_kx_publickeybytes();
2524
+ r.length !== h && y(a, "invalid clientPublicKey length"), d = m(r), a.push(d);
2525
+ var g = new p(0 | n._crypto_kx_sessionkeybytes()), b = g.address;
2526
+ a.push(b);
2527
+ var S = new p(0 | n._crypto_kx_sessionkeybytes()), C = S.address;
2528
+ if (a.push(C), !(0 | n._crypto_kx_server_session_keys(b, C, o, c, d))) {
2529
+ var w = u({
2530
+ sharedRx: g,
2531
+ sharedTx: S
2532
+ }, i);
2533
+ return _(a), w;
2534
+ }
2535
+ v(a, "invalid usage");
2536
+ }
2537
+ function _n(e, t, r) {
2538
+ var i = [];
2539
+ f(r);
2540
+ var a = m(e = x(i, e, "message")), o = e.length;
2541
+ i.push(a), t = x(i, t, "key");
2542
+ var s, c = 0 | n._crypto_onetimeauth_keybytes();
2543
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
2544
+ var l = new p(0 | n._crypto_onetimeauth_bytes()), d = l.address;
2545
+ if (i.push(d), !(0 | n._crypto_onetimeauth(d, a, o, 0, s))) {
2546
+ var h = u(l, r);
2547
+ return _(i), h;
2548
+ }
2549
+ v(i, "invalid usage");
2550
+ }
2551
+ function vn(e, t) {
2552
+ var r = [];
2553
+ f(t), b(r, e, "state_address");
2554
+ var i = new p(0 | n._crypto_onetimeauth_bytes()), a = i.address;
2555
+ if (r.push(a), !(0 | n._crypto_onetimeauth_final(e, a))) {
2556
+ var o = (n._free(e), u(i, t));
2557
+ return _(r), o;
2558
+ }
2559
+ v(r, "invalid usage");
2560
+ }
2561
+ function yn(e, t) {
2562
+ var r = [];
2563
+ f(t);
2564
+ var i = null;
2565
+ e != null && (i = m(e = x(r, e, "key")), e.length, r.push(i));
2566
+ var a = new p(144).address;
2567
+ if (!(0 | n._crypto_onetimeauth_init(a, i))) {
2568
+ var o = a;
2569
+ return _(r), o;
2570
+ }
2571
+ v(r, "invalid usage");
2572
+ }
2573
+ function bn(e) {
2574
+ var t = [];
2575
+ f(e);
2576
+ var r = new p(0 | n._crypto_onetimeauth_keybytes()), i = r.address;
2577
+ t.push(i), n._crypto_onetimeauth_keygen(i);
2578
+ var a = u(r, e);
2579
+ return _(t), a;
2580
+ }
2581
+ function xn(e, t, r) {
2582
+ var i = [];
2583
+ f(r), b(i, e, "state_address");
2584
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
2585
+ i.push(a), 0 | n._crypto_onetimeauth_update(e, a, o) && v(i, "invalid usage"), _(i);
2586
+ }
2587
+ function Sn(e, t, r) {
2588
+ var i = [];
2589
+ e = x(i, e, "hash");
2590
+ var a, o = 0 | n._crypto_onetimeauth_bytes();
2591
+ e.length !== o && y(i, "invalid hash length"), a = m(e), i.push(a);
2592
+ var s = m(t = x(i, t, "message")), c = t.length;
2593
+ i.push(s), r = x(i, r, "key");
2594
+ var l, u = 0 | n._crypto_onetimeauth_keybytes();
2595
+ r.length !== u && y(i, "invalid key length"), l = m(r), i.push(l);
2596
+ var d = !(0 | n._crypto_onetimeauth_verify(a, s, c, 0, l));
2597
+ return _(i), d;
2598
+ }
2599
+ function Cn(e, t, r, i, a, o, s) {
2600
+ var c = [];
2601
+ f(s), b(c, e, "keyLength"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(c, "keyLength must be an unsigned integer");
2602
+ var l = m(t = x(c, t, "password")), d = t.length;
2603
+ c.push(l), r = x(c, r, "salt");
2604
+ var h, g = 0 | n._crypto_pwhash_saltbytes();
2605
+ r.length !== g && y(c, "invalid salt length"), h = m(r), c.push(h), b(c, i, "opsLimit"), (typeof i != "number" || (0 | i) !== i || i < 0) && y(c, "opsLimit must be an unsigned integer"), b(c, a, "memLimit"), (typeof a != "number" || (0 | a) !== a || a < 0) && y(c, "memLimit must be an unsigned integer"), b(c, o, "algorithm"), (typeof o != "number" || (0 | o) !== o || o < 0) && y(c, "algorithm must be an unsigned integer");
2606
+ var S = new p(0 | e), C = S.address;
2607
+ if (c.push(C), !(0 | n._crypto_pwhash(C, e, 0, l, d, 0, h, i, 0, a, o))) {
2608
+ var w = u(S, s);
2609
+ return _(c), w;
2610
+ }
2611
+ v(c, "invalid usage");
2612
+ }
2613
+ function wn(e, t, r, i, a, o) {
2614
+ var s = [];
2615
+ f(o), b(s, e, "keyLength"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(s, "keyLength must be an unsigned integer");
2616
+ var c = m(t = x(s, t, "password")), l = t.length;
2617
+ s.push(c), r = x(s, r, "salt");
2618
+ var d, h = 0 | n._crypto_pwhash_scryptsalsa208sha256_saltbytes();
2619
+ r.length !== h && y(s, "invalid salt length"), d = m(r), s.push(d), b(s, i, "opsLimit"), (typeof i != "number" || (0 | i) !== i || i < 0) && y(s, "opsLimit must be an unsigned integer"), b(s, a, "memLimit"), (typeof a != "number" || (0 | a) !== a || a < 0) && y(s, "memLimit must be an unsigned integer");
2620
+ var g = new p(0 | e), S = g.address;
2621
+ if (s.push(S), !(0 | n._crypto_pwhash_scryptsalsa208sha256(S, e, 0, c, l, 0, d, i, 0, a))) {
2622
+ var C = u(g, o);
2623
+ return _(s), C;
2624
+ }
2625
+ v(s, "invalid usage");
2626
+ }
2627
+ function Tn(e, t, r, i, a, o, s) {
2628
+ var c = [];
2629
+ f(s);
2630
+ var l = m(e = x(c, e, "password")), d = e.length;
2631
+ c.push(l);
2632
+ var h = m(t = x(c, t, "salt")), g = t.length;
2633
+ c.push(h), b(c, r, "opsLimit"), (typeof r != "number" || (0 | r) !== r || r < 0) && y(c, "opsLimit must be an unsigned integer"), b(c, i, "r"), (typeof i != "number" || (0 | i) !== i || i < 0) && y(c, "r must be an unsigned integer"), b(c, a, "p"), (typeof a != "number" || (0 | a) !== a || a < 0) && y(c, "p must be an unsigned integer"), b(c, o, "keyLength"), (typeof o != "number" || (0 | o) !== o || o < 0) && y(c, "keyLength must be an unsigned integer");
2634
+ var S = new p(0 | o), C = S.address;
2635
+ if (c.push(C), !(0 | n._crypto_pwhash_scryptsalsa208sha256_ll(l, d, h, g, r, 0, i, a, C, o))) {
2636
+ var w = u(S, s);
2637
+ return _(c), w;
2638
+ }
2639
+ v(c, "invalid usage");
2640
+ }
2641
+ function En(e, t, r, i) {
2642
+ var a = [];
2643
+ f(i);
2644
+ var o = m(e = x(a, e, "password")), s = e.length;
2645
+ a.push(o), b(a, t, "opsLimit"), (typeof t != "number" || (0 | t) !== t || t < 0) && y(a, "opsLimit must be an unsigned integer"), b(a, r, "memLimit"), (typeof r != "number" || (0 | r) !== r || r < 0) && y(a, "memLimit must be an unsigned integer");
2646
+ var c = new p(0 | n._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;
2647
+ if (a.push(c), !(0 | n._crypto_pwhash_scryptsalsa208sha256_str(c, o, s, 0, t, 0, r))) {
2648
+ var l = n.UTF8ToString(c);
2649
+ return _(a), l;
2650
+ }
2651
+ v(a, "invalid usage");
2652
+ }
2653
+ function Dn(e, t, r) {
2654
+ var a = [];
2655
+ f(r), typeof e != "string" && y(a, "hashed_password must be a string");
2656
+ var o = m(e = i(e + "\0"));
2657
+ e.length, a.push(o);
2658
+ var s = m(t = x(a, t, "password")), c = t.length;
2659
+ a.push(s);
2660
+ var l = !(0 | n._crypto_pwhash_scryptsalsa208sha256_str_verify(o, s, c, 0));
2661
+ return _(a), l;
2662
+ }
2663
+ function On(e, t, r, i) {
2664
+ var a = [];
2665
+ f(i);
2666
+ var o = m(e = x(a, e, "password")), s = e.length;
2667
+ a.push(o), b(a, t, "opsLimit"), (typeof t != "number" || (0 | t) !== t || t < 0) && y(a, "opsLimit must be an unsigned integer"), b(a, r, "memLimit"), (typeof r != "number" || (0 | r) !== r || r < 0) && y(a, "memLimit must be an unsigned integer");
2668
+ var c = new p(0 | n._crypto_pwhash_strbytes()).address;
2669
+ if (a.push(c), !(0 | n._crypto_pwhash_str(c, o, s, 0, t, 0, r))) {
2670
+ var l = n.UTF8ToString(c);
2671
+ return _(a), l;
2672
+ }
2673
+ v(a, "invalid usage");
2674
+ }
2675
+ function kn(e, t, r, a) {
2676
+ var o = [];
2677
+ f(a), typeof e != "string" && y(o, "hashed_password must be a string");
2678
+ var s = m(e = i(e + "\0"));
2679
+ e.length, o.push(s), b(o, t, "opsLimit"), (typeof t != "number" || (0 | t) !== t || t < 0) && y(o, "opsLimit must be an unsigned integer"), b(o, r, "memLimit"), (typeof r != "number" || (0 | r) !== r || r < 0) && y(o, "memLimit must be an unsigned integer");
2680
+ var c = !!(0 | n._crypto_pwhash_str_needs_rehash(s, t, 0, r));
2681
+ return _(o), c;
2682
+ }
2683
+ function An(e, t, r) {
2684
+ var a = [];
2685
+ f(r), typeof e != "string" && y(a, "hashed_password must be a string");
2686
+ var o = m(e = i(e + "\0"));
2687
+ e.length, a.push(o);
2688
+ var s = m(t = x(a, t, "password")), c = t.length;
2689
+ a.push(s);
2690
+ var l = !(0 | n._crypto_pwhash_str_verify(o, s, c, 0));
2691
+ return _(a), l;
2692
+ }
2693
+ function jn(e, t, r) {
2694
+ var i = [];
2695
+ f(r), e = x(i, e, "privateKey");
2696
+ var a, o = 0 | n._crypto_scalarmult_scalarbytes();
2697
+ e.length !== o && y(i, "invalid privateKey length"), a = m(e), i.push(a), t = x(i, t, "publicKey");
2698
+ var s, c = 0 | n._crypto_scalarmult_bytes();
2699
+ t.length !== c && y(i, "invalid publicKey length"), s = m(t), i.push(s);
2700
+ var l = new p(0 | n._crypto_scalarmult_bytes()), d = l.address;
2701
+ if (i.push(d), !(0 | n._crypto_scalarmult(d, a, s))) {
2702
+ var h = u(l, r);
2703
+ return _(i), h;
2704
+ }
2705
+ v(i, "weak public key");
2706
+ }
2707
+ function Mn(e, t) {
2708
+ var r = [];
2709
+ f(t), e = x(r, e, "privateKey");
2710
+ var i, a = 0 | n._crypto_scalarmult_scalarbytes();
2711
+ e.length !== a && y(r, "invalid privateKey length"), i = m(e), r.push(i);
2712
+ var o = new p(0 | n._crypto_scalarmult_bytes()), s = o.address;
2713
+ if (r.push(s), !(0 | n._crypto_scalarmult_base(s, i))) {
2714
+ var c = u(o, t);
2715
+ return _(r), c;
2716
+ }
2717
+ v(r, "unknown error");
2718
+ }
2719
+ function Nn(e, t, r) {
2720
+ var i = [];
2721
+ f(r), e = x(i, e, "n");
2722
+ var a, o = 0 | n._crypto_scalarmult_ed25519_scalarbytes();
2723
+ e.length !== o && y(i, "invalid n length"), a = m(e), i.push(a), t = x(i, t, "p");
2724
+ var s, c = 0 | n._crypto_scalarmult_ed25519_bytes();
2725
+ t.length !== c && y(i, "invalid p length"), s = m(t), i.push(s);
2726
+ var l = new p(0 | n._crypto_scalarmult_ed25519_bytes()), d = l.address;
2727
+ if (i.push(d), !(0 | n._crypto_scalarmult_ed25519(d, a, s))) {
2728
+ var h = u(l, r);
2729
+ return _(i), h;
2730
+ }
2731
+ v(i, "invalid point or scalar is 0");
2732
+ }
2733
+ function Pn(e, t) {
2734
+ var r = [];
2735
+ f(t), e = x(r, e, "scalar");
2736
+ var i, a = 0 | n._crypto_scalarmult_ed25519_scalarbytes();
2737
+ e.length !== a && y(r, "invalid scalar length"), i = m(e), r.push(i);
2738
+ var o = new p(0 | n._crypto_scalarmult_ed25519_bytes()), s = o.address;
2739
+ if (r.push(s), !(0 | n._crypto_scalarmult_ed25519_base(s, i))) {
2740
+ var c = u(o, t);
2741
+ return _(r), c;
2742
+ }
2743
+ v(r, "scalar is 0");
2744
+ }
2745
+ function Fn(e, t) {
2746
+ var r = [];
2747
+ f(t), e = x(r, e, "scalar");
2748
+ var i, a = 0 | n._crypto_scalarmult_ed25519_scalarbytes();
2749
+ e.length !== a && y(r, "invalid scalar length"), i = m(e), r.push(i);
2750
+ var o = new p(0 | n._crypto_scalarmult_ed25519_bytes()), s = o.address;
2751
+ if (r.push(s), !(0 | n._crypto_scalarmult_ed25519_base_noclamp(s, i))) {
2752
+ var c = u(o, t);
2753
+ return _(r), c;
2754
+ }
2755
+ v(r, "scalar is 0");
2756
+ }
2757
+ function In(e, t, r) {
2758
+ var i = [];
2759
+ f(r), e = x(i, e, "n");
2760
+ var a, o = 0 | n._crypto_scalarmult_ed25519_scalarbytes();
2761
+ e.length !== o && y(i, "invalid n length"), a = m(e), i.push(a), t = x(i, t, "p");
2762
+ var s, c = 0 | n._crypto_scalarmult_ed25519_bytes();
2763
+ t.length !== c && y(i, "invalid p length"), s = m(t), i.push(s);
2764
+ var l = new p(0 | n._crypto_scalarmult_ed25519_bytes()), d = l.address;
2765
+ if (i.push(d), !(0 | n._crypto_scalarmult_ed25519_noclamp(d, a, s))) {
2766
+ var h = u(l, r);
2767
+ return _(i), h;
2768
+ }
2769
+ v(i, "invalid point or scalar is 0");
2770
+ }
2771
+ function Ln(e, t, r) {
2772
+ var i = [];
2773
+ f(r), e = x(i, e, "scalar");
2774
+ var a, o = 0 | n._crypto_scalarmult_ristretto255_scalarbytes();
2775
+ e.length !== o && y(i, "invalid scalar length"), a = m(e), i.push(a), t = x(i, t, "element");
2776
+ var s, c = 0 | n._crypto_scalarmult_ristretto255_bytes();
2777
+ t.length !== c && y(i, "invalid element length"), s = m(t), i.push(s);
2778
+ var l = new p(0 | n._crypto_scalarmult_ristretto255_bytes()), d = l.address;
2779
+ if (i.push(d), !(0 | n._crypto_scalarmult_ristretto255(d, a, s))) {
2780
+ var h = u(l, r);
2781
+ return _(i), h;
2782
+ }
2783
+ v(i, "result is identity element");
2784
+ }
2785
+ function Rn(e, t) {
2786
+ var r = [];
2787
+ f(t), e = x(r, e, "scalar");
2788
+ var i, a = 0 | n._crypto_core_ristretto255_scalarbytes();
2789
+ e.length !== a && y(r, "invalid scalar length"), i = m(e), r.push(i);
2790
+ var o = new p(0 | n._crypto_core_ristretto255_bytes()), s = o.address;
2791
+ if (r.push(s), !(0 | n._crypto_scalarmult_ristretto255_base(s, i))) {
2792
+ var c = u(o, t);
2793
+ return _(r), c;
2794
+ }
2795
+ v(r, "scalar is 0");
2796
+ }
2797
+ function zn(e, t, r, i) {
2798
+ var a = [];
2799
+ f(i);
2800
+ var o = m(e = x(a, e, "message")), s = e.length;
2801
+ a.push(o), t = x(a, t, "nonce");
2802
+ var c, l = 0 | n._crypto_secretbox_noncebytes();
2803
+ t.length !== l && y(a, "invalid nonce length"), c = m(t), a.push(c), r = x(a, r, "key");
2804
+ var d, h = 0 | n._crypto_secretbox_keybytes();
2805
+ r.length !== h && y(a, "invalid key length"), d = m(r), a.push(d);
2806
+ var g = new p(0 | s), b = g.address;
2807
+ a.push(b);
2808
+ var S = new p(0 | n._crypto_secretbox_macbytes()), C = S.address;
2809
+ if (a.push(C), !(0 | n._crypto_secretbox_detached(b, C, o, s, 0, c, d))) {
2810
+ var w = u({
2811
+ mac: S,
2812
+ cipher: g
2813
+ }, i);
2814
+ return _(a), w;
2815
+ }
2816
+ v(a, "invalid usage");
2817
+ }
2818
+ function Bn(e, t, r, i) {
2819
+ var a = [];
2820
+ f(i);
2821
+ var o = m(e = x(a, e, "message")), s = e.length;
2822
+ a.push(o), t = x(a, t, "nonce");
2823
+ var c, l = 0 | n._crypto_secretbox_noncebytes();
2824
+ t.length !== l && y(a, "invalid nonce length"), c = m(t), a.push(c), r = x(a, r, "key");
2825
+ var d, h = 0 | n._crypto_secretbox_keybytes();
2826
+ r.length !== h && y(a, "invalid key length"), d = m(r), a.push(d);
2827
+ var g = new p(s + n._crypto_secretbox_macbytes() | 0), b = g.address;
2828
+ if (a.push(b), !(0 | n._crypto_secretbox_easy(b, o, s, 0, c, d))) {
2829
+ var S = u(g, i);
2830
+ return _(a), S;
2831
+ }
2832
+ v(a, "invalid usage");
2833
+ }
2834
+ function Vn(e) {
2835
+ var t = [];
2836
+ f(e);
2837
+ var r = new p(0 | n._crypto_secretbox_keybytes()), i = r.address;
2838
+ t.push(i), n._crypto_secretbox_keygen(i);
2839
+ var a = u(r, e);
2840
+ return _(t), a;
2841
+ }
2842
+ function Hn(e, t, r, i, a) {
2843
+ var o = [];
2844
+ f(a);
2845
+ var s = m(e = x(o, e, "ciphertext")), c = e.length;
2846
+ o.push(s), t = x(o, t, "mac");
2847
+ var l, d = 0 | n._crypto_secretbox_macbytes();
2848
+ t.length !== d && y(o, "invalid mac length"), l = m(t), o.push(l), r = x(o, r, "nonce");
2849
+ var h, g = 0 | n._crypto_secretbox_noncebytes();
2850
+ r.length !== g && y(o, "invalid nonce length"), h = m(r), o.push(h), i = x(o, i, "key");
2851
+ var b, S = 0 | n._crypto_secretbox_keybytes();
2852
+ i.length !== S && y(o, "invalid key length"), b = m(i), o.push(b);
2853
+ var C = new p(0 | c), w = C.address;
2854
+ if (o.push(w), !(0 | n._crypto_secretbox_open_detached(w, s, l, c, 0, h, b))) {
2855
+ var T = u(C, a);
2856
+ return _(o), T;
2857
+ }
2858
+ v(o, "wrong secret key for the given ciphertext");
2859
+ }
2860
+ function Un(e, t, r, i) {
2861
+ var a = [];
2862
+ f(i), e = x(a, e, "ciphertext");
2863
+ var o, s = n._crypto_secretbox_macbytes(), c = e.length;
2864
+ c < s && y(a, "ciphertext is too short"), o = m(e), a.push(o), t = x(a, t, "nonce");
2865
+ var l, d = 0 | n._crypto_secretbox_noncebytes();
2866
+ t.length !== d && y(a, "invalid nonce length"), l = m(t), a.push(l), r = x(a, r, "key");
2867
+ var h, g = 0 | n._crypto_secretbox_keybytes();
2868
+ r.length !== g && y(a, "invalid key length"), h = m(r), a.push(h);
2869
+ var b = new p(c - n._crypto_secretbox_macbytes() | 0), S = b.address;
2870
+ if (a.push(S), !(0 | n._crypto_secretbox_open_easy(S, o, c, 0, l, h))) {
2871
+ var C = u(b, i);
2872
+ return _(a), C;
2873
+ }
2874
+ v(a, "wrong secret key for the given ciphertext");
2875
+ }
2876
+ function Wn(e, t, r) {
2877
+ var i = [];
2878
+ f(r), e = x(i, e, "header");
2879
+ var a, o = 0 | n._crypto_secretstream_xchacha20poly1305_headerbytes();
2880
+ e.length !== o && y(i, "invalid header length"), a = m(e), i.push(a), t = x(i, t, "key");
2881
+ var s, c = 0 | n._crypto_secretstream_xchacha20poly1305_keybytes();
2882
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
2883
+ var l = new p(52).address;
2884
+ if (!(0 | n._crypto_secretstream_xchacha20poly1305_init_pull(l, a, s))) {
2885
+ var u = l;
2886
+ return _(i), u;
2887
+ }
2888
+ v(i, "invalid usage");
2889
+ }
2890
+ function Gn(e, t) {
2891
+ var r = [];
2892
+ f(t), e = x(r, e, "key");
2893
+ var i, a = 0 | n._crypto_secretstream_xchacha20poly1305_keybytes();
2894
+ e.length !== a && y(r, "invalid key length"), i = m(e), r.push(i);
2895
+ var o = new p(52).address, s = new p(0 | n._crypto_secretstream_xchacha20poly1305_headerbytes()), c = s.address;
2896
+ if (r.push(c), !(0 | n._crypto_secretstream_xchacha20poly1305_init_push(o, c, i))) {
2897
+ var l = {
2898
+ state: o,
2899
+ header: u(s, t)
2900
+ };
2901
+ return _(r), l;
2902
+ }
2903
+ v(r, "invalid usage");
2904
+ }
2905
+ function Kn(e) {
2906
+ var t = [];
2907
+ f(e);
2908
+ var r = new p(0 | n._crypto_secretstream_xchacha20poly1305_keybytes()), i = r.address;
2909
+ t.push(i), n._crypto_secretstream_xchacha20poly1305_keygen(i);
2910
+ var a = u(r, e);
2911
+ return _(t), a;
2912
+ }
2913
+ function qn(e, t, r, i) {
2914
+ var a = [];
2915
+ f(i), b(a, e, "state_address"), t = x(a, t, "cipher");
2916
+ var o, s = n._crypto_secretstream_xchacha20poly1305_abytes(), c = t.length;
2917
+ c < s && y(a, "cipher is too short"), o = m(t), a.push(o);
2918
+ var l = null, d = 0;
2919
+ r != null && (l = m(r = x(a, r, "ad")), d = r.length, a.push(l));
2920
+ var g = new p(c - n._crypto_secretstream_xchacha20poly1305_abytes() | 0), v = g.address;
2921
+ a.push(v);
2922
+ var S, C = (S = h(1), a.push(S), (C = n._crypto_secretstream_xchacha20poly1305_pull(e, v, 0, S, o, c, 0, l, d) === 0 && {
2923
+ tag: n.HEAPU8[S],
2924
+ message: g
2925
+ }) && {
2926
+ message: u(C.message, i),
2927
+ tag: C.tag
2928
+ });
2929
+ return _(a), C;
2930
+ }
2931
+ function Jn(e, t, r, i, a) {
2932
+ var o = [];
2933
+ f(a), b(o, e, "state_address");
2934
+ var s = m(t = x(o, t, "message_chunk")), c = t.length;
2935
+ o.push(s);
2936
+ var l = null, d = 0;
2937
+ r != null && (l = m(r = x(o, r, "ad")), d = r.length, o.push(l)), b(o, i, "tag"), (typeof i != "number" || (0 | i) !== i || i < 0) && y(o, "tag must be an unsigned integer");
2938
+ var h = new p(c + n._crypto_secretstream_xchacha20poly1305_abytes() | 0), g = h.address;
2939
+ if (o.push(g), !(0 | n._crypto_secretstream_xchacha20poly1305_push(e, g, 0, s, c, 0, l, d, 0, i))) {
2940
+ var S = u(h, a);
2941
+ return _(o), S;
2942
+ }
2943
+ v(o, "invalid usage");
2944
+ }
2945
+ function Yn(e, t) {
2946
+ var r = [];
2947
+ return f(t), b(r, e, "state_address"), n._crypto_secretstream_xchacha20poly1305_rekey(e), _(r), !0;
2948
+ }
2949
+ function Xn(e, t, r) {
2950
+ var i = [];
2951
+ f(r);
2952
+ var a = m(e = x(i, e, "message")), o = e.length;
2953
+ i.push(a), t = x(i, t, "key");
2954
+ var s, c = 0 | n._crypto_shorthash_keybytes();
2955
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
2956
+ var l = new p(0 | n._crypto_shorthash_bytes()), d = l.address;
2957
+ if (i.push(d), !(0 | n._crypto_shorthash(d, a, o, 0, s))) {
2958
+ var h = u(l, r);
2959
+ return _(i), h;
2960
+ }
2961
+ v(i, "invalid usage");
2962
+ }
2963
+ function Zn(e) {
2964
+ var t = [];
2965
+ f(e);
2966
+ var r = new p(0 | n._crypto_shorthash_keybytes()), i = r.address;
2967
+ t.push(i), n._crypto_shorthash_keygen(i);
2968
+ var a = u(r, e);
2969
+ return _(t), a;
2970
+ }
2971
+ function Qn(e, t, r) {
2972
+ var i = [];
2973
+ f(r);
2974
+ var a = m(e = x(i, e, "message")), o = e.length;
2975
+ i.push(a), t = x(i, t, "key");
2976
+ var s, c = 0 | n._crypto_shorthash_siphashx24_keybytes();
2977
+ t.length !== c && y(i, "invalid key length"), s = m(t), i.push(s);
2978
+ var l = new p(0 | n._crypto_shorthash_siphashx24_bytes()), d = l.address;
2979
+ if (i.push(d), !(0 | n._crypto_shorthash_siphashx24(d, a, o, 0, s))) {
2980
+ var h = u(l, r);
2981
+ return _(i), h;
2982
+ }
2983
+ v(i, "invalid usage");
2984
+ }
2985
+ function $n(e, t, r) {
2986
+ var i = [];
2987
+ f(r);
2988
+ var a = m(e = x(i, e, "message")), o = e.length;
2989
+ i.push(a), t = x(i, t, "privateKey");
2990
+ var s, c = 0 | n._crypto_sign_secretkeybytes();
2991
+ t.length !== c && y(i, "invalid privateKey length"), s = m(t), i.push(s);
2992
+ var l = new p(e.length + n._crypto_sign_bytes() | 0), d = l.address;
2993
+ if (i.push(d), !(0 | n._crypto_sign(d, null, a, o, 0, s))) {
2994
+ var h = u(l, r);
2995
+ return _(i), h;
2996
+ }
2997
+ v(i, "invalid usage");
2998
+ }
2999
+ function er(e, t, r) {
3000
+ var i = [];
3001
+ f(r);
3002
+ var a = m(e = x(i, e, "message")), o = e.length;
3003
+ i.push(a), t = x(i, t, "privateKey");
3004
+ var s, c = 0 | n._crypto_sign_secretkeybytes();
3005
+ t.length !== c && y(i, "invalid privateKey length"), s = m(t), i.push(s);
3006
+ var l = new p(0 | n._crypto_sign_bytes()), d = l.address;
3007
+ if (i.push(d), !(0 | n._crypto_sign_detached(d, null, a, o, 0, s))) {
3008
+ var h = u(l, r);
3009
+ return _(i), h;
3010
+ }
3011
+ v(i, "invalid usage");
3012
+ }
3013
+ function tr(e, t) {
3014
+ var r = [];
3015
+ f(t), e = x(r, e, "edPk");
3016
+ var i, a = 0 | n._crypto_sign_publickeybytes();
3017
+ e.length !== a && y(r, "invalid edPk length"), i = m(e), r.push(i);
3018
+ var o = new p(0 | n._crypto_scalarmult_scalarbytes()), s = o.address;
3019
+ if (r.push(s), !(0 | n._crypto_sign_ed25519_pk_to_curve25519(s, i))) {
3020
+ var c = u(o, t);
3021
+ return _(r), c;
3022
+ }
3023
+ v(r, "invalid key");
3024
+ }
3025
+ function nr(e, t) {
3026
+ var r = [];
3027
+ f(t), e = x(r, e, "edSk");
3028
+ var i, a = 0 | n._crypto_sign_secretkeybytes();
3029
+ e.length !== a && y(r, "invalid edSk length"), i = m(e), r.push(i);
3030
+ var o = new p(0 | n._crypto_scalarmult_scalarbytes()), s = o.address;
3031
+ if (r.push(s), !(0 | n._crypto_sign_ed25519_sk_to_curve25519(s, i))) {
3032
+ var c = u(o, t);
3033
+ return _(r), c;
3034
+ }
3035
+ v(r, "invalid key");
3036
+ }
3037
+ function rr(e, t) {
3038
+ var r = [];
3039
+ f(t), e = x(r, e, "privateKey");
3040
+ var i, a = 0 | n._crypto_sign_secretkeybytes();
3041
+ e.length !== a && y(r, "invalid privateKey length"), i = m(e), r.push(i);
3042
+ var o = new p(0 | n._crypto_sign_publickeybytes()), s = o.address;
3043
+ if (r.push(s), !(0 | n._crypto_sign_ed25519_sk_to_pk(s, i))) {
3044
+ var c = u(o, t);
3045
+ return _(r), c;
3046
+ }
3047
+ v(r, "invalid key");
3048
+ }
3049
+ function ir(e, t) {
3050
+ var r = [];
3051
+ f(t), e = x(r, e, "privateKey");
3052
+ var i, a = 0 | n._crypto_sign_secretkeybytes();
3053
+ e.length !== a && y(r, "invalid privateKey length"), i = m(e), r.push(i);
3054
+ var o = new p(0 | n._crypto_sign_seedbytes()), s = o.address;
3055
+ if (r.push(s), !(0 | n._crypto_sign_ed25519_sk_to_seed(s, i))) {
3056
+ var c = u(o, t);
3057
+ return _(r), c;
3058
+ }
3059
+ v(r, "invalid key");
3060
+ }
3061
+ function ar(e, t, r) {
3062
+ var i = [];
3063
+ f(r), b(i, e, "state_address"), t = x(i, t, "privateKey");
3064
+ var a, o = 0 | n._crypto_sign_secretkeybytes();
3065
+ t.length !== o && y(i, "invalid privateKey length"), a = m(t), i.push(a);
3066
+ var s = new p(0 | n._crypto_sign_bytes()), c = s.address;
3067
+ if (i.push(c), !(0 | n._crypto_sign_final_create(e, c, null, a))) {
3068
+ var l = (n._free(e), u(s, r));
3069
+ return _(i), l;
3070
+ }
3071
+ v(i, "invalid usage");
3072
+ }
3073
+ function or(e, t, r, i) {
3074
+ var a = [];
3075
+ f(i), b(a, e, "state_address"), t = x(a, t, "signature");
3076
+ var o, s = 0 | n._crypto_sign_bytes();
3077
+ t.length !== s && y(a, "invalid signature length"), o = m(t), a.push(o), r = x(a, r, "publicKey");
3078
+ var c, l = 0 | n._crypto_sign_publickeybytes();
3079
+ r.length !== l && y(a, "invalid publicKey length"), c = m(r), a.push(c);
3080
+ var u = !(0 | n._crypto_sign_final_verify(e, o, c));
3081
+ return _(a), u;
3082
+ }
3083
+ function sr(e) {
3084
+ var t = [];
3085
+ f(e);
3086
+ var r = new p(208).address;
3087
+ if (!(0 | n._crypto_sign_init(r))) {
3088
+ var i = r;
3089
+ return _(t), i;
3090
+ }
3091
+ v(t, "internal error");
3092
+ }
3093
+ function cr(e) {
3094
+ var t = [];
3095
+ f(e);
3096
+ var r = new p(0 | n._crypto_sign_publickeybytes()), i = r.address;
3097
+ t.push(i);
3098
+ var a = new p(0 | n._crypto_sign_secretkeybytes()), o = a.address;
3099
+ if (t.push(o), !(0 | n._crypto_sign_keypair(i, o))) {
3100
+ var s = {
3101
+ publicKey: u(r, e),
3102
+ privateKey: u(a, e),
3103
+ keyType: "ed25519"
3104
+ };
3105
+ return _(t), s;
3106
+ }
3107
+ v(t, "internal error");
3108
+ }
3109
+ function lr(e, t, r) {
3110
+ var i = [];
3111
+ f(r), e = x(i, e, "signedMessage");
3112
+ var a, o = n._crypto_sign_bytes(), s = e.length;
3113
+ s < o && y(i, "signedMessage is too short"), a = m(e), i.push(a), t = x(i, t, "publicKey");
3114
+ var c, l = 0 | n._crypto_sign_publickeybytes();
3115
+ t.length !== l && y(i, "invalid publicKey length"), c = m(t), i.push(c);
3116
+ var d = new p(s - n._crypto_sign_bytes() | 0), h = d.address;
3117
+ if (i.push(h), !(0 | n._crypto_sign_open(h, null, a, s, 0, c))) {
3118
+ var g = u(d, r);
3119
+ return _(i), g;
3120
+ }
3121
+ v(i, "incorrect signature for the given public key");
3122
+ }
3123
+ function ur(e, t) {
3124
+ var r = [];
3125
+ f(t), e = x(r, e, "seed");
3126
+ var i, a = 0 | n._crypto_sign_seedbytes();
3127
+ e.length !== a && y(r, "invalid seed length"), i = m(e), r.push(i);
3128
+ var o = new p(0 | n._crypto_sign_publickeybytes()), s = o.address;
3129
+ r.push(s);
3130
+ var c = new p(0 | n._crypto_sign_secretkeybytes()), l = c.address;
3131
+ if (r.push(l), !(0 | n._crypto_sign_seed_keypair(s, l, i))) {
3132
+ var d = {
3133
+ publicKey: u(o, t),
3134
+ privateKey: u(c, t),
3135
+ keyType: "ed25519"
3136
+ };
3137
+ return _(r), d;
3138
+ }
3139
+ v(r, "invalid usage");
3140
+ }
3141
+ function dr(e, t, r) {
3142
+ var i = [];
3143
+ f(r), b(i, e, "state_address");
3144
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
3145
+ i.push(a), 0 | n._crypto_sign_update(e, a, o, 0) && v(i, "invalid usage"), _(i);
3146
+ }
3147
+ function fr(e, t, r) {
3148
+ var i = [];
3149
+ e = x(i, e, "signature");
3150
+ var a, o = 0 | n._crypto_sign_bytes();
3151
+ e.length !== o && y(i, "invalid signature length"), a = m(e), i.push(a);
3152
+ var s = m(t = x(i, t, "message")), c = t.length;
3153
+ i.push(s), r = x(i, r, "publicKey");
3154
+ var l, u = 0 | n._crypto_sign_publickeybytes();
3155
+ r.length !== u && y(i, "invalid publicKey length"), l = m(r), i.push(l);
3156
+ var d = !(0 | n._crypto_sign_verify_detached(a, s, c, 0, l));
3157
+ return _(i), d;
3158
+ }
3159
+ function pr(e, t, r, i) {
3160
+ var a = [];
3161
+ f(i), b(a, e, "outLength"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(a, "outLength must be an unsigned integer"), t = x(a, t, "key");
3162
+ var o, s = 0 | n._crypto_stream_chacha20_keybytes();
3163
+ t.length !== s && y(a, "invalid key length"), o = m(t), a.push(o), r = x(a, r, "nonce");
3164
+ var c, l = 0 | n._crypto_stream_chacha20_noncebytes();
3165
+ r.length !== l && y(a, "invalid nonce length"), c = m(r), a.push(c);
3166
+ var d = new p(0 | e), h = d.address;
3167
+ a.push(h), n._crypto_stream_chacha20(h, e, 0, c, o);
3168
+ var g = u(d, i);
3169
+ return _(a), g;
3170
+ }
3171
+ function mr(e, t, r, i) {
3172
+ var a = [];
3173
+ f(i);
3174
+ var o = m(e = x(a, e, "input_message")), s = e.length;
3175
+ a.push(o), t = x(a, t, "nonce");
3176
+ var c, l = 0 | n._crypto_stream_chacha20_ietf_noncebytes();
3177
+ t.length !== l && y(a, "invalid nonce length"), c = m(t), a.push(c), r = x(a, r, "key");
3178
+ var d, h = 0 | n._crypto_stream_chacha20_ietf_keybytes();
3179
+ r.length !== h && y(a, "invalid key length"), d = m(r), a.push(d);
3180
+ var g = new p(0 | s), b = g.address;
3181
+ if (a.push(b), n._crypto_stream_chacha20_ietf_xor(b, o, s, 0, c, d) === 0) {
3182
+ var S = u(g, i);
3183
+ return _(a), S;
3184
+ }
3185
+ v(a, "invalid usage");
3186
+ }
3187
+ function hr(e, t, r, i, a) {
3188
+ var o = [];
3189
+ f(a);
3190
+ var s = m(e = x(o, e, "input_message")), c = e.length;
3191
+ o.push(s), t = x(o, t, "nonce");
3192
+ var l, d = 0 | n._crypto_stream_chacha20_ietf_noncebytes();
3193
+ t.length !== d && y(o, "invalid nonce length"), l = m(t), o.push(l), b(o, r, "nonce_increment"), (typeof r != "number" || (0 | r) !== r || r < 0) && y(o, "nonce_increment must be an unsigned integer"), i = x(o, i, "key");
3194
+ var h, g = 0 | n._crypto_stream_chacha20_ietf_keybytes();
3195
+ i.length !== g && y(o, "invalid key length"), h = m(i), o.push(h);
3196
+ var S = new p(0 | c), C = S.address;
3197
+ if (o.push(C), n._crypto_stream_chacha20_ietf_xor_ic(C, s, c, 0, l, r, h) === 0) {
3198
+ var w = u(S, a);
3199
+ return _(o), w;
3200
+ }
3201
+ v(o, "invalid usage");
3202
+ }
3203
+ function gr(e) {
3204
+ var t = [];
3205
+ f(e);
3206
+ var r = new p(0 | n._crypto_stream_chacha20_keybytes()), i = r.address;
3207
+ t.push(i), n._crypto_stream_chacha20_keygen(i);
3208
+ var a = u(r, e);
3209
+ return _(t), a;
3210
+ }
3211
+ function _r(e, t, r, i) {
3212
+ var a = [];
3213
+ f(i);
3214
+ var o = m(e = x(a, e, "input_message")), s = e.length;
3215
+ a.push(o), t = x(a, t, "nonce");
3216
+ var c, l = 0 | n._crypto_stream_chacha20_noncebytes();
3217
+ t.length !== l && y(a, "invalid nonce length"), c = m(t), a.push(c), r = x(a, r, "key");
3218
+ var d, h = 0 | n._crypto_stream_chacha20_keybytes();
3219
+ r.length !== h && y(a, "invalid key length"), d = m(r), a.push(d);
3220
+ var g = new p(0 | s), b = g.address;
3221
+ if (a.push(b), n._crypto_stream_chacha20_xor(b, o, s, 0, c, d) === 0) {
3222
+ var S = u(g, i);
3223
+ return _(a), S;
3224
+ }
3225
+ v(a, "invalid usage");
3226
+ }
3227
+ function vr(e, t, r, i, a) {
3228
+ var o = [];
3229
+ f(a);
3230
+ var s = m(e = x(o, e, "input_message")), c = e.length;
3231
+ o.push(s), t = x(o, t, "nonce");
3232
+ var l, d = 0 | n._crypto_stream_chacha20_noncebytes();
3233
+ t.length !== d && y(o, "invalid nonce length"), l = m(t), o.push(l), b(o, r, "nonce_increment"), (typeof r != "number" || (0 | r) !== r || r < 0) && y(o, "nonce_increment must be an unsigned integer"), i = x(o, i, "key");
3234
+ var h, g = 0 | n._crypto_stream_chacha20_keybytes();
3235
+ i.length !== g && y(o, "invalid key length"), h = m(i), o.push(h);
3236
+ var S = new p(0 | c), C = S.address;
3237
+ if (o.push(C), n._crypto_stream_chacha20_xor_ic(C, s, c, 0, l, r, 0, h) === 0) {
3238
+ var w = u(S, a);
3239
+ return _(o), w;
3240
+ }
3241
+ v(o, "invalid usage");
3242
+ }
3243
+ function yr(e) {
3244
+ var t = [];
3245
+ f(e);
3246
+ var r = new p(0 | n._crypto_stream_keybytes()), i = r.address;
3247
+ t.push(i), n._crypto_stream_keygen(i);
3248
+ var a = u(r, e);
3249
+ return _(t), a;
3250
+ }
3251
+ function br(e) {
3252
+ var t = [];
3253
+ f(e);
3254
+ var r = new p(0 | n._crypto_stream_xchacha20_keybytes()), i = r.address;
3255
+ t.push(i), n._crypto_stream_xchacha20_keygen(i);
3256
+ var a = u(r, e);
3257
+ return _(t), a;
3258
+ }
3259
+ function xr(e, t, r, i) {
3260
+ var a = [];
3261
+ f(i);
3262
+ var o = m(e = x(a, e, "input_message")), s = e.length;
3263
+ a.push(o), t = x(a, t, "nonce");
3264
+ var c, l = 0 | n._crypto_stream_xchacha20_noncebytes();
3265
+ t.length !== l && y(a, "invalid nonce length"), c = m(t), a.push(c), r = x(a, r, "key");
3266
+ var d, h = 0 | n._crypto_stream_xchacha20_keybytes();
3267
+ r.length !== h && y(a, "invalid key length"), d = m(r), a.push(d);
3268
+ var g = new p(0 | s), b = g.address;
3269
+ if (a.push(b), n._crypto_stream_xchacha20_xor(b, o, s, 0, c, d) === 0) {
3270
+ var S = u(g, i);
3271
+ return _(a), S;
3272
+ }
3273
+ v(a, "invalid usage");
3274
+ }
3275
+ function Sr(e, t, r, i, a) {
3276
+ var o = [];
3277
+ f(a);
3278
+ var s = m(e = x(o, e, "input_message")), c = e.length;
3279
+ o.push(s), t = x(o, t, "nonce");
3280
+ var l, d = 0 | n._crypto_stream_xchacha20_noncebytes();
3281
+ t.length !== d && y(o, "invalid nonce length"), l = m(t), o.push(l), b(o, r, "nonce_increment"), (typeof r != "number" || (0 | r) !== r || r < 0) && y(o, "nonce_increment must be an unsigned integer"), i = x(o, i, "key");
3282
+ var h, g = 0 | n._crypto_stream_xchacha20_keybytes();
3283
+ i.length !== g && y(o, "invalid key length"), h = m(i), o.push(h);
3284
+ var S = new p(0 | c), C = S.address;
3285
+ if (o.push(C), n._crypto_stream_xchacha20_xor_ic(C, s, c, 0, l, r, 0, h) === 0) {
3286
+ var w = u(S, a);
3287
+ return _(o), w;
3288
+ }
3289
+ v(o, "invalid usage");
3290
+ }
3291
+ function Cr(e, t, r) {
3292
+ var i = [];
3293
+ f(r), b(i, e, "out_length"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(i, "out_length must be an unsigned integer");
3294
+ var a = m(t = x(i, t, "message")), o = t.length;
3295
+ i.push(a);
3296
+ var s = new p(e |= 0), c = s.address;
3297
+ if (i.push(c), !(0 | n._crypto_xof_shake128(c, e, a, o, 0))) {
3298
+ var l = u(s, r);
3299
+ return _(i), l;
3300
+ }
3301
+ v(i, "invalid usage");
3302
+ }
3303
+ function wr(e) {
3304
+ var t = [];
3305
+ f(e);
3306
+ var r = new p(256).address;
3307
+ if (!(0 | n._crypto_xof_shake128_init(r))) {
3308
+ var i = r;
3309
+ return _(t), i;
3310
+ }
3311
+ v(t, "invalid usage");
3312
+ }
3313
+ function Tr(e, t) {
3314
+ var r = [];
3315
+ f(t), b(r, e, "domain"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(r, "domain must be an unsigned integer");
3316
+ var i = new p(256).address;
3317
+ if (!(0 | n._crypto_xof_shake128_init_with_domain(i, e))) {
3318
+ var a = i;
3319
+ return _(r), a;
3320
+ }
3321
+ v(r, "invalid usage");
3322
+ }
3323
+ function Er(e, t, r) {
3324
+ var i = [];
3325
+ f(r), b(i, e, "state_address"), b(i, t, "out_length"), (typeof t != "number" || (0 | t) !== t || t < 0) && y(i, "out_length must be an unsigned integer");
3326
+ var a = new p(t |= 0), o = a.address;
3327
+ if (i.push(o), !(0 | n._crypto_xof_shake128_squeeze(e, o, t))) {
3328
+ var s = u(a, r);
3329
+ return _(i), s;
3330
+ }
3331
+ v(i, "invalid usage");
3332
+ }
3333
+ function Dr(e, t, r) {
3334
+ var i = [];
3335
+ f(r), b(i, e, "state_address");
3336
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
3337
+ i.push(a), 0 | n._crypto_xof_shake128_update(e, a, o, 0) && v(i, "invalid usage"), _(i);
3338
+ }
3339
+ function Or(e, t, r) {
3340
+ var i = [];
3341
+ f(r), b(i, e, "out_length"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(i, "out_length must be an unsigned integer");
3342
+ var a = m(t = x(i, t, "message")), o = t.length;
3343
+ i.push(a);
3344
+ var s = new p(e |= 0), c = s.address;
3345
+ if (i.push(c), !(0 | n._crypto_xof_shake256(c, e, a, o, 0))) {
3346
+ var l = u(s, r);
3347
+ return _(i), l;
3348
+ }
3349
+ v(i, "invalid usage");
3350
+ }
3351
+ function kr(e) {
3352
+ var t = [];
3353
+ f(e);
3354
+ var r = new p(256).address;
3355
+ if (!(0 | n._crypto_xof_shake256_init(r))) {
3356
+ var i = r;
3357
+ return _(t), i;
3358
+ }
3359
+ v(t, "invalid usage");
3360
+ }
3361
+ function Ar(e, t) {
3362
+ var r = [];
3363
+ f(t), b(r, e, "domain"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(r, "domain must be an unsigned integer");
3364
+ var i = new p(256).address;
3365
+ if (!(0 | n._crypto_xof_shake256_init_with_domain(i, e))) {
3366
+ var a = i;
3367
+ return _(r), a;
3368
+ }
3369
+ v(r, "invalid usage");
3370
+ }
3371
+ function jr(e, t, r) {
3372
+ var i = [];
3373
+ f(r), b(i, e, "state_address"), b(i, t, "out_length"), (typeof t != "number" || (0 | t) !== t || t < 0) && y(i, "out_length must be an unsigned integer");
3374
+ var a = new p(t |= 0), o = a.address;
3375
+ if (i.push(o), !(0 | n._crypto_xof_shake256_squeeze(e, o, t))) {
3376
+ var s = u(a, r);
3377
+ return _(i), s;
3378
+ }
3379
+ v(i, "invalid usage");
3380
+ }
3381
+ function Mr(e, t, r) {
3382
+ var i = [];
3383
+ f(r), b(i, e, "state_address");
3384
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
3385
+ i.push(a), 0 | n._crypto_xof_shake256_update(e, a, o, 0) && v(i, "invalid usage"), _(i);
3386
+ }
3387
+ function $(e, t, r) {
3388
+ var i = [];
3389
+ f(r), b(i, e, "out_length"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(i, "out_length must be an unsigned integer");
3390
+ var a = m(t = x(i, t, "message")), o = t.length;
3391
+ i.push(a);
3392
+ var s = new p(e |= 0), c = s.address;
3393
+ if (i.push(c), !(0 | n._crypto_xof_turboshake128(c, e, a, o, 0))) {
3394
+ var l = u(s, r);
3395
+ return _(i), l;
3396
+ }
3397
+ v(i, "invalid usage");
3398
+ }
3399
+ function Nr(e) {
3400
+ var t = [];
3401
+ f(e);
3402
+ var r = new p(256).address;
3403
+ if (!(0 | n._crypto_xof_turboshake128_init(r))) {
3404
+ var i = r;
3405
+ return _(t), i;
3406
+ }
3407
+ v(t, "invalid usage");
3408
+ }
3409
+ function Pr(e, t) {
3410
+ var r = [];
3411
+ f(t), b(r, e, "domain"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(r, "domain must be an unsigned integer");
3412
+ var i = new p(256).address;
3413
+ if (!(0 | n._crypto_xof_turboshake128_init_with_domain(i, e))) {
3414
+ var a = i;
3415
+ return _(r), a;
3416
+ }
3417
+ v(r, "invalid usage");
3418
+ }
3419
+ function Fr(e, t, r) {
3420
+ var i = [];
3421
+ f(r), b(i, e, "state_address"), b(i, t, "out_length"), (typeof t != "number" || (0 | t) !== t || t < 0) && y(i, "out_length must be an unsigned integer");
3422
+ var a = new p(t |= 0), o = a.address;
3423
+ if (i.push(o), !(0 | n._crypto_xof_turboshake128_squeeze(e, o, t))) {
3424
+ var s = u(a, r);
3425
+ return _(i), s;
3426
+ }
3427
+ v(i, "invalid usage");
3428
+ }
3429
+ function Ir(e, t, r) {
3430
+ var i = [];
3431
+ f(r), b(i, e, "state_address");
3432
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
3433
+ i.push(a), 0 | n._crypto_xof_turboshake128_update(e, a, o, 0) && v(i, "invalid usage"), _(i);
3434
+ }
3435
+ function Lr(e, t, r) {
3436
+ var i = [];
3437
+ f(r), b(i, e, "out_length"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(i, "out_length must be an unsigned integer");
3438
+ var a = m(t = x(i, t, "message")), o = t.length;
3439
+ i.push(a);
3440
+ var s = new p(e |= 0), c = s.address;
3441
+ if (i.push(c), !(0 | n._crypto_xof_turboshake256(c, e, a, o, 0))) {
3442
+ var l = u(s, r);
3443
+ return _(i), l;
3444
+ }
3445
+ v(i, "invalid usage");
3446
+ }
3447
+ function Rr(e) {
3448
+ var t = [];
3449
+ f(e);
3450
+ var r = new p(256).address;
3451
+ if (!(0 | n._crypto_xof_turboshake256_init(r))) {
3452
+ var i = r;
3453
+ return _(t), i;
3454
+ }
3455
+ v(t, "invalid usage");
3456
+ }
3457
+ function zr(e, t) {
3458
+ var r = [];
3459
+ f(t), b(r, e, "domain"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(r, "domain must be an unsigned integer");
3460
+ var i = new p(256).address;
3461
+ if (!(0 | n._crypto_xof_turboshake256_init_with_domain(i, e))) {
3462
+ var a = i;
3463
+ return _(r), a;
3464
+ }
3465
+ v(r, "invalid usage");
3466
+ }
3467
+ function Br(e, t, r) {
3468
+ var i = [];
3469
+ f(r), b(i, e, "state_address"), b(i, t, "out_length"), (typeof t != "number" || (0 | t) !== t || t < 0) && y(i, "out_length must be an unsigned integer");
3470
+ var a = new p(t |= 0), o = a.address;
3471
+ if (i.push(o), !(0 | n._crypto_xof_turboshake256_squeeze(e, o, t))) {
3472
+ var s = u(a, r);
3473
+ return _(i), s;
3474
+ }
3475
+ v(i, "invalid usage");
3476
+ }
3477
+ function Vr(e, t, r) {
3478
+ var i = [];
3479
+ f(r), b(i, e, "state_address");
3480
+ var a = m(t = x(i, t, "message_chunk")), o = t.length;
3481
+ i.push(a), 0 | n._crypto_xof_turboshake256_update(e, a, o, 0) && v(i, "invalid usage"), _(i);
3482
+ }
3483
+ function Hr(e, t) {
3484
+ var r = [];
3485
+ f(t), b(r, e, "length"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(r, "length must be an unsigned integer");
3486
+ var i = new p(0 | e), a = i.address;
3487
+ r.push(a), n._randombytes_buf(a, e);
3488
+ var o = u(i, t);
3489
+ return _(r), o;
3490
+ }
3491
+ function Ur(e, t, r) {
3492
+ var i = [];
3493
+ f(r), b(i, e, "length"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(i, "length must be an unsigned integer"), t = x(i, t, "seed");
3494
+ var a, o = 0 | n._randombytes_seedbytes();
3495
+ t.length !== o && y(i, "invalid seed length"), a = m(t), i.push(a);
3496
+ var s = new p(0 | e), c = s.address;
3497
+ i.push(c), n._randombytes_buf_deterministic(c, e, a);
3498
+ var l = u(s, r);
3499
+ return _(i), l;
3500
+ }
3501
+ function Wr(e) {
3502
+ f(e), n._randombytes_close();
3503
+ }
3504
+ function Gr(e) {
3505
+ f(e);
3506
+ var t = n._randombytes_random() >>> 0;
3507
+ return _([]), t;
3508
+ }
3509
+ function Kr(e, t) {
3510
+ var r = [];
3511
+ f(t);
3512
+ for (var i = n._malloc(24), a = 0; a < 6; a++) n.setValue(i + 4 * a, n.Runtime.addFunction(e[[
3513
+ "implementation_name",
3514
+ "random",
3515
+ "stir",
3516
+ "uniform",
3517
+ "buf",
3518
+ "close"
3519
+ ][a]]), "i32");
3520
+ 0 | n._randombytes_set_implementation(i) && v(r, "unsupported implementation"), _(r);
3521
+ }
3522
+ function qr(e) {
3523
+ f(e), n._randombytes_stir();
3524
+ }
3525
+ function Jr(e, t) {
3526
+ var r = [];
3527
+ f(t), b(r, e, "upper_bound"), (typeof e != "number" || (0 | e) !== e || e < 0) && y(r, "upper_bound must be an unsigned integer");
3528
+ var i = n._randombytes_uniform(e) >>> 0;
3529
+ return _(r), i;
3530
+ }
3531
+ function Yr(e) {
3532
+ var t, r = [];
3533
+ (e = x(r, e, "bin")).length !== 16 && y(r, "invalid bin length"), t = m(e), r.push(t);
3534
+ var i = new p(46).address;
3535
+ if (r.push(i), n._sodium_bin2ip(i, 46, t) !== 0) {
3536
+ var a = n.UTF8ToString(i);
3537
+ return _(r), a;
3538
+ }
3539
+ v(r, "conversion failed");
3540
+ }
3541
+ function Xr(e, t) {
3542
+ var r = [];
3543
+ f(t), typeof e != "string" && y(r, "ip must be a string");
3544
+ var a = m(e = i(e + "\0")), o = e.length - 1;
3545
+ r.push(a);
3546
+ var s = new p(16), c = s.address;
3547
+ if (r.push(c), !(0 | n._sodium_ip2bin(c, a, o))) {
3548
+ var l = u(s, t);
3549
+ return _(r), l;
3550
+ }
3551
+ v(r, "invalid IP address");
3552
+ }
3553
+ function Zr() {
3554
+ var e = n._sodium_version_string(), t = n.UTF8ToString(e);
3555
+ return _([]), t;
3556
+ }
3557
+ return p.prototype.to_Uint8Array = function() {
3558
+ var e = new Uint8Array(this.length);
3559
+ return e.set(n.HEAPU8.subarray(this.address, this.address + this.length)), e;
3560
+ }, e.add = function(e, t) {
3561
+ if (!(e instanceof Uint8Array && t instanceof Uint8Array)) throw TypeError("Only Uint8Array instances can be added");
3562
+ var n = e.length, r = 0, i = 0;
3563
+ if (t.length !== e.length) throw TypeError("Arguments must have the same length");
3564
+ for (i = 0; i < n; i++) r >>= 8, r += e[i] + t[i], e[i] = 255 & r;
3565
+ }, e.base64_variants = s, e.compare = function(e, t) {
3566
+ if (!(e instanceof Uint8Array && t instanceof Uint8Array)) throw TypeError("Only Uint8Array instances can be compared");
3567
+ if (e.length !== t.length) throw TypeError("Only instances of identical length can be compared");
3568
+ for (var n = 0, r = 1, i = e.length; i-- > 0;) n |= t[i] - e[i] >> 8 & r, r &= (t[i] ^ e[i]) - 1 >> 8;
3569
+ return n + n + r - 1;
3570
+ }, e.from_base64 = function(e, t) {
3571
+ t = c(t);
3572
+ var r, i = [], a = new p(3 * (e = x(i, e, "input")).length / 4), o = m(e), s = h(4), l = h(4);
3573
+ return i.push(o), i.push(a.address), i.push(s), i.push(l), n._sodium_base642bin(a.address, a.length, o, e.length, 0, s, l, t) !== 0 && v(i, "invalid input"), n.getValue(l, "i32") - o !== e.length && v(i, "incomplete input"), a.length = n.getValue(s, "i32"), r = a.to_Uint8Array(), _(i), r;
3574
+ }, e.from_hex = function(e) {
3575
+ var t, r = [], i = new p((e = x(r, e, "input")).length / 2), a = m(e), o = h(4);
3576
+ return r.push(a), r.push(i.address), r.push(o), n._sodium_hex2bin(i.address, i.length, a, e.length, 0, 0, o) !== 0 && v(r, "invalid input"), n.getValue(o, "i32") - a !== e.length && v(r, "incomplete input"), t = i.to_Uint8Array(), _(r), t;
3577
+ }, e.from_string = i, e.increment = function(e) {
3578
+ if (!(e instanceof Uint8Array)) throw TypeError("Only Uint8Array instances can be incremented");
3579
+ for (var t = 256, n = 0, r = e.length; n < r; n++) t >>= 8, t += e[n], e[n] = 255 & t;
3580
+ }, e.is_zero = function(e) {
3581
+ if (!(e instanceof Uint8Array)) throw TypeError("Only Uint8Array instances can be checked");
3582
+ for (var t = 0, n = 0, r = e.length; n < r; n++) t |= e[n];
3583
+ return t === 0;
3584
+ }, e.libsodium = t, e.memcmp = function(e, t) {
3585
+ if (!(e instanceof Uint8Array && t instanceof Uint8Array)) throw TypeError("Only Uint8Array instances can be compared");
3586
+ if (e.length !== t.length) throw TypeError("Only instances of identical length can be compared");
3587
+ for (var n = 0, r = 0, i = e.length; r < i; r++) n |= e[r] ^ t[r];
3588
+ return n === 0;
3589
+ }, e.memzero = function(e) {
3590
+ if (!(e instanceof Uint8Array)) throw TypeError("Only Uint8Array instances can be wiped");
3591
+ for (var t = 0, n = e.length; t < n; t++) e[t] = 0;
3592
+ }, e.output_formats = function() {
3593
+ return [
3594
+ "uint8array",
3595
+ "text",
3596
+ "hex",
3597
+ "base64"
3598
+ ];
3599
+ }, e.pad = function(e, t) {
3600
+ if (!(e instanceof Uint8Array)) throw TypeError("buffer must be a Uint8Array");
3601
+ if ((t |= 0) <= 0) throw Error("block size must be > 0");
3602
+ var r, i = [], a = h(4), o = 1, s = 0, c = 0 | e.length, l = new p(c + t);
3603
+ i.push(a), i.push(l.address);
3604
+ for (var u = l.address, d = l.address + c + t; u < d; u++) n.HEAPU8[u] = e[s], s += o = 1 & ~((65535 & ((c -= o) >>> 48 | c >>> 32 | c >>> 16 | c)) - 1 >> 16);
3605
+ return n._sodium_pad(a, l.address, e.length, t, l.length) !== 0 && v(i, "internal error"), l.length = n.getValue(a, "i32"), r = l.to_Uint8Array(), _(i), r;
3606
+ }, e.unpad = function(e, t) {
3607
+ if (!(e instanceof Uint8Array)) throw TypeError("buffer must be a Uint8Array");
3608
+ if ((t |= 0) <= 0) throw Error("block size must be > 0");
3609
+ var r = [], i = m(e), a = h(4);
3610
+ return r.push(i), r.push(a), n._sodium_unpad(a, i, e.length, t) !== 0 && v(r, "unsupported/invalid padding"), e = (e = new Uint8Array(e)).subarray(0, n.getValue(a, "i32")), _(r), e;
3611
+ }, e.ready = r, e.symbols = function() {
3612
+ return Object.keys(e).sort();
3613
+ }, e.to_base64 = l, e.to_hex = o, e.to_string = a, e;
3614
+ }
3615
+ var i = typeof n.sodium == "object" && typeof n.sodium.onload == "function" ? n.sodium.onload : null;
3616
+ typeof define == "function" && define.amd ? define(["exports", "libsodium"], r) : typeof e == "object" && typeof e.nodeName != "string" ? r(e, t()) : n.sodium = r(n.commonJsStrict = {}, n.libsodium), i && n.sodium.ready.then(function() {
3617
+ i(n.sodium);
3618
+ });
3619
+ })(e);
3620
+ }));
3621
+ //#endregion
3622
+ export default n();
3623
+ export { n as require_libsodium_wrappers };