@nmshd/crypto 1.0.8 → 1.0.9

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 (89) hide show
  1. package/dist/CryptoPrivateKey.d.ts +8 -8
  2. package/dist/CryptoPrivateKey.js +13 -13
  3. package/dist/CryptoPrivateKey.js.map +1 -1
  4. package/dist/CryptoPublicKey.d.ts +8 -8
  5. package/dist/CryptoPublicKey.js +13 -13
  6. package/dist/CryptoPublicKey.js.map +1 -1
  7. package/dist/CryptoSerializable.d.ts +5 -0
  8. package/dist/CryptoSerializable.js +15 -0
  9. package/dist/CryptoSerializable.js.map +1 -0
  10. package/dist/SodiumWrapper.js +5 -1
  11. package/dist/SodiumWrapper.js.map +1 -1
  12. package/dist/buildInformation.js +5 -5
  13. package/dist/encryption/CryptoCipher.d.ts +6 -6
  14. package/dist/encryption/CryptoCipher.js +8 -8
  15. package/dist/encryption/CryptoCipher.js.map +1 -1
  16. package/dist/encryption/CryptoSecretKey.d.ts +6 -6
  17. package/dist/encryption/CryptoSecretKey.js +7 -7
  18. package/dist/encryption/CryptoSecretKey.js.map +1 -1
  19. package/dist/exchange/CryptoExchange.js +3 -3
  20. package/dist/exchange/CryptoExchange.js.map +1 -1
  21. package/dist/exchange/CryptoExchangeKeypair.d.ts +8 -8
  22. package/dist/exchange/CryptoExchangeKeypair.js +12 -16
  23. package/dist/exchange/CryptoExchangeKeypair.js.map +1 -1
  24. package/dist/exchange/CryptoExchangePrivateKey.d.ts +6 -6
  25. package/dist/exchange/CryptoExchangePrivateKey.js +4 -4
  26. package/dist/exchange/CryptoExchangePrivateKey.js.map +1 -1
  27. package/dist/exchange/CryptoExchangePublicKey.d.ts +4 -4
  28. package/dist/exchange/CryptoExchangePublicKey.js +7 -7
  29. package/dist/exchange/CryptoExchangePublicKey.js.map +1 -1
  30. package/dist/exchange/CryptoExchangeSecrets.d.ts +7 -7
  31. package/dist/exchange/CryptoExchangeSecrets.js +6 -6
  32. package/dist/exchange/CryptoExchangeSecrets.js.map +1 -1
  33. package/dist/index.js +5 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/relationship/CryptoRelationshipPublicRequest.d.ts +8 -8
  36. package/dist/relationship/CryptoRelationshipPublicRequest.js +16 -20
  37. package/dist/relationship/CryptoRelationshipPublicRequest.js.map +1 -1
  38. package/dist/relationship/CryptoRelationshipPublicResponse.d.ts +8 -8
  39. package/dist/relationship/CryptoRelationshipPublicResponse.js +14 -18
  40. package/dist/relationship/CryptoRelationshipPublicResponse.js.map +1 -1
  41. package/dist/relationship/CryptoRelationshipRequestSecrets.d.ts +7 -7
  42. package/dist/relationship/CryptoRelationshipRequestSecrets.js +9 -9
  43. package/dist/relationship/CryptoRelationshipRequestSecrets.js.map +1 -1
  44. package/dist/relationship/CryptoRelationshipSecrets.d.ts +7 -7
  45. package/dist/relationship/CryptoRelationshipSecrets.js +10 -10
  46. package/dist/relationship/CryptoRelationshipSecrets.js.map +1 -1
  47. package/dist/signature/CryptoSignature.d.ts +8 -8
  48. package/dist/signature/CryptoSignature.js +8 -8
  49. package/dist/signature/CryptoSignature.js.map +1 -1
  50. package/dist/signature/CryptoSignatureKeypair.d.ts +8 -8
  51. package/dist/signature/CryptoSignatureKeypair.js +12 -16
  52. package/dist/signature/CryptoSignatureKeypair.js.map +1 -1
  53. package/dist/signature/CryptoSignaturePrivateKey.d.ts +6 -6
  54. package/dist/signature/CryptoSignaturePrivateKey.js +6 -6
  55. package/dist/signature/CryptoSignaturePrivateKey.js.map +1 -1
  56. package/dist/signature/CryptoSignaturePublicKey.d.ts +6 -6
  57. package/dist/signature/CryptoSignaturePublicKey.js +7 -7
  58. package/dist/signature/CryptoSignaturePublicKey.js.map +1 -1
  59. package/dist/signature/CryptoSignatures.js +1 -1
  60. package/dist/signature/CryptoSignatures.js.map +1 -1
  61. package/dist/state/CryptoPrivateState.d.ts +6 -6
  62. package/dist/state/CryptoPrivateState.js +5 -5
  63. package/dist/state/CryptoPrivateState.js.map +1 -1
  64. package/dist/state/CryptoPrivateStateReceive.d.ts +3 -3
  65. package/dist/state/CryptoPrivateStateReceive.js +4 -4
  66. package/dist/state/CryptoPrivateStateReceive.js.map +1 -1
  67. package/dist/state/CryptoPrivateStateTransmit.d.ts +3 -3
  68. package/dist/state/CryptoPrivateStateTransmit.js +4 -4
  69. package/dist/state/CryptoPrivateStateTransmit.js.map +1 -1
  70. package/dist/state/CryptoPublicState.d.ts +7 -7
  71. package/dist/state/CryptoPublicState.js +7 -7
  72. package/dist/state/CryptoPublicState.js.map +1 -1
  73. package/dist/stream/CryptoStreamAddress.d.ts +5 -5
  74. package/dist/stream/CryptoStreamAddress.js +5 -5
  75. package/dist/stream/CryptoStreamAddress.js.map +1 -1
  76. package/dist/stream/CryptoStreamHeader.d.ts +6 -6
  77. package/dist/stream/CryptoStreamHeader.js +4 -4
  78. package/dist/stream/CryptoStreamHeader.js.map +1 -1
  79. package/dist/stream/CryptoStreamState.d.ts +5 -5
  80. package/dist/stream/CryptoStreamState.js +6 -6
  81. package/dist/stream/CryptoStreamState.js.map +1 -1
  82. package/lib-web/nmshd.crypto.js +221 -238
  83. package/lib-web/nmshd.crypto.js.map +1 -1
  84. package/lib-web/nmshd.crypto.min.js +1 -1
  85. package/lib-web/nmshd.crypto.min.js.map +1 -1
  86. package/package.json +16 -16
  87. package/dist/CryptoSerializableAsync.d.ts +0 -5
  88. package/dist/CryptoSerializableAsync.js +0 -24
  89. package/dist/CryptoSerializableAsync.js.map +0 -1
@@ -711,8 +711,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
711
711
  exports.CryptoPrivateKey = void 0;
712
712
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
713
713
  const CoreBuffer_1 = __webpack_require__(/*! ./CoreBuffer */ "./dist/CoreBuffer.js");
714
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ./CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
715
- let CryptoPrivateKey = CryptoPrivateKey_1 = class CryptoPrivateKey extends CryptoSerializableAsync_1.CryptoSerializableAsync {
714
+ const CryptoSerializable_1 = __webpack_require__(/*! ./CryptoSerializable */ "./dist/CryptoSerializable.js");
715
+ let CryptoPrivateKey = CryptoPrivateKey_1 = class CryptoPrivateKey extends CryptoSerializable_1.CryptoSerializable {
716
716
  constructor(algorithm, privateKey) {
717
717
  super();
718
718
  this.algorithm = algorithm;
@@ -740,33 +740,33 @@ let CryptoPrivateKey = CryptoPrivateKey_1 = class CryptoPrivateKey extends Crypt
740
740
  pem = pem.replace(/(?:\r\n|\r|\n)/g, "");
741
741
  return pem;
742
742
  }
743
- static async deserialize(value) {
743
+ static deserialize(value) {
744
744
  const obj = JSON.parse(value);
745
- return await this.from(obj);
745
+ return this.from(obj);
746
746
  }
747
747
  static fromString(value, algorithm, encoding = CoreBuffer_1.Encoding.Base64_UrlSafe_NoPadding) {
748
748
  const buffer = CoreBuffer_1.CoreBuffer.fromString(value, encoding);
749
- return Promise.resolve(new CryptoPrivateKey_1(algorithm, buffer));
749
+ return new CryptoPrivateKey_1(algorithm, buffer);
750
750
  }
751
751
  static fromObject(value, algorithm) {
752
752
  const buffer = CoreBuffer_1.CoreBuffer.fromObject(value);
753
- return Promise.resolve(new CryptoPrivateKey_1(algorithm, buffer));
753
+ return new CryptoPrivateKey_1(algorithm, buffer);
754
754
  }
755
- static async fromPEM(pem, algorithm) {
755
+ static fromPEM(pem, algorithm) {
756
756
  const value = this.stripPEM(pem);
757
- return await this.fromString(value, algorithm, CoreBuffer_1.Encoding.Base64);
757
+ return this.fromString(value, algorithm, CoreBuffer_1.Encoding.Base64);
758
758
  }
759
- static async from(value) {
759
+ static from(value) {
760
760
  if (!value || !value.publicKey || !value.algorithm) {
761
761
  throw new Error("No value, public key or algorithm set");
762
762
  }
763
763
  if (typeof value.privateKey === "string") {
764
- return await this.fromString(value.privateKey, value.algorithm);
764
+ return this.fromString(value.privateKey, value.algorithm);
765
765
  }
766
- return await this.fromObject(value.privateKey, value.algorithm);
766
+ return this.fromObject(value.privateKey, value.algorithm);
767
767
  }
768
- static async fromBase64(value) {
769
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
768
+ static fromBase64(value) {
769
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
770
770
  }
771
771
  };
772
772
  CryptoPrivateKey = CryptoPrivateKey_1 = __decorate([
@@ -800,8 +800,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
800
800
  exports.CryptoPublicKey = void 0;
801
801
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
802
802
  const CoreBuffer_1 = __webpack_require__(/*! ./CoreBuffer */ "./dist/CoreBuffer.js");
803
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ./CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
804
- let CryptoPublicKey = CryptoPublicKey_1 = class CryptoPublicKey extends CryptoSerializableAsync_1.CryptoSerializableAsync {
803
+ const CryptoSerializable_1 = __webpack_require__(/*! ./CryptoSerializable */ "./dist/CryptoSerializable.js");
804
+ let CryptoPublicKey = CryptoPublicKey_1 = class CryptoPublicKey extends CryptoSerializable_1.CryptoSerializable {
805
805
  constructor(algorithm, publicKey) {
806
806
  super();
807
807
  this.algorithm = algorithm;
@@ -829,33 +829,33 @@ let CryptoPublicKey = CryptoPublicKey_1 = class CryptoPublicKey extends CryptoSe
829
829
  pem = pem.replace(/(?:\r\n|\r|\n)/g, "");
830
830
  return pem;
831
831
  }
832
- static async fromPEM(pem, algorithm) {
832
+ static fromPEM(pem, algorithm) {
833
833
  const value = this.stripPEM(pem);
834
- return await this.fromString(value, algorithm, CoreBuffer_1.Encoding.Base64);
834
+ return this.fromString(value, algorithm, CoreBuffer_1.Encoding.Base64);
835
835
  }
836
836
  static fromString(value, algorithm, encoding = CoreBuffer_1.Encoding.Base64_UrlSafe_NoPadding) {
837
837
  const buffer = CoreBuffer_1.CoreBuffer.fromString(value, encoding);
838
- return Promise.resolve(new CryptoPublicKey_1(algorithm, buffer));
838
+ return new CryptoPublicKey_1(algorithm, buffer);
839
839
  }
840
840
  static fromObject(value, algorithm) {
841
841
  const buffer = CoreBuffer_1.CoreBuffer.fromObject(value);
842
- return Promise.resolve(new CryptoPublicKey_1(algorithm, buffer));
842
+ return new CryptoPublicKey_1(algorithm, buffer);
843
843
  }
844
- static async deserialize(value) {
844
+ static deserialize(value) {
845
845
  const obj = JSON.parse(value);
846
- return await this.from(obj);
846
+ return this.from(obj);
847
847
  }
848
- static async from(value) {
848
+ static from(value) {
849
849
  if (!value || !value.publicKey || !value.algorithm) {
850
850
  throw new Error("No value, public key or algorithm set");
851
851
  }
852
852
  if (typeof value.privateKey === "string") {
853
- return await this.fromString(value.publicKey, value.algorithm);
853
+ return this.fromString(value.publicKey, value.algorithm);
854
854
  }
855
- return await this.fromObject(value.publicKey, value.algorithm);
855
+ return this.fromObject(value.publicKey, value.algorithm);
856
856
  }
857
- static async fromBase64(value) {
858
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
857
+ static fromBase64(value) {
858
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
859
859
  }
860
860
  };
861
861
  CryptoPublicKey = CryptoPublicKey_1 = __decorate([
@@ -867,37 +867,28 @@ exports.CryptoPublicKey = CryptoPublicKey;
867
867
 
868
868
  /***/ }),
869
869
 
870
- /***/ "./dist/CryptoSerializableAsync.js":
871
- /*!*****************************************!*\
872
- !*** ./dist/CryptoSerializableAsync.js ***!
873
- \*****************************************/
874
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
870
+ /***/ "./dist/CryptoSerializable.js":
871
+ /*!************************************!*\
872
+ !*** ./dist/CryptoSerializable.js ***!
873
+ \************************************/
874
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
875
875
 
876
876
  "use strict";
877
877
 
878
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
879
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
880
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
881
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
882
- return c > 3 && r && Object.defineProperty(target, key, r), r;
883
- };
884
878
  Object.defineProperty(exports, "__esModule", ({ value: true }));
885
- exports.CryptoSerializableAsync = void 0;
879
+ exports.CryptoSerializable = void 0;
886
880
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
887
881
  const CoreBuffer_1 = __webpack_require__(/*! ./CoreBuffer */ "./dist/CoreBuffer.js");
888
- let CryptoSerializableAsync = class CryptoSerializableAsync extends ts_serval_1.SerializableAsync {
882
+ class CryptoSerializable extends ts_serval_1.Serializable {
889
883
  serialize(verbose = true) {
890
884
  return JSON.stringify(this.toJSON(verbose));
891
885
  }
892
886
  toBase64(verbose = true) {
893
887
  return CoreBuffer_1.CoreBuffer.utf8_base64(this.serialize(verbose));
894
888
  }
895
- };
896
- CryptoSerializableAsync = __decorate([
897
- (0, ts_serval_1.type)("CryptoSerializableAsync")
898
- ], CryptoSerializableAsync);
899
- exports.CryptoSerializableAsync = CryptoSerializableAsync;
900
- //# sourceMappingURL=CryptoSerializableAsync.js.map
889
+ }
890
+ exports.CryptoSerializable = CryptoSerializable;
891
+ //# sourceMappingURL=CryptoSerializable.js.map
901
892
 
902
893
  /***/ }),
903
894
 
@@ -1177,7 +1168,11 @@ exports.CryptoValidation = CryptoValidation;
1177
1168
 
1178
1169
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
1179
1170
  if (k2 === undefined) k2 = k;
1180
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
1171
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1172
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1173
+ desc = { enumerable: true, get: function() { return m[k]; } };
1174
+ }
1175
+ Object.defineProperty(o, k2, desc);
1181
1176
  }) : (function(o, m, k, k2) {
1182
1177
  if (k2 === undefined) k2 = k;
1183
1178
  o[k2] = m[k];
@@ -1238,11 +1233,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
1238
1233
  exports.buildInformation = void 0;
1239
1234
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
1240
1235
  exports.buildInformation = {
1241
- version: "1.0.8",
1242
- build: "10",
1243
- date: "2022-01-24T16:59:04+00:00",
1244
- commit: "bc03eafc9935d98a4be1b59707d5162852e53a48",
1245
- dependencies: {"libsodium-wrappers-sumo":"0.7.9","uuid":"8.3.2"},
1236
+ version: "1.0.9",
1237
+ build: "11",
1238
+ date: "2022-04-08T09:13:42+00:00",
1239
+ commit: "f770c223193bd5f68e610032ab8c2ec1ba193b63",
1240
+ dependencies: {"libsodium-wrappers-sumo":"0.7.10","uuid":"8.3.2"},
1246
1241
  libraries: {
1247
1242
  serval: ts_serval_1.buildInformation
1248
1243
  }
@@ -1275,9 +1270,9 @@ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-s
1275
1270
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
1276
1271
  const CryptoError_1 = __webpack_require__(/*! ../CryptoError */ "./dist/CryptoError.js");
1277
1272
  const CryptoErrorCode_1 = __webpack_require__(/*! ../CryptoErrorCode */ "./dist/CryptoErrorCode.js");
1278
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ../CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
1273
+ const CryptoSerializable_1 = __webpack_require__(/*! ../CryptoSerializable */ "./dist/CryptoSerializable.js");
1279
1274
  const CryptoValidation_1 = __webpack_require__(/*! ../CryptoValidation */ "./dist/CryptoValidation.js");
1280
- let CryptoCipher = CryptoCipher_1 = class CryptoCipher extends CryptoSerializableAsync_1.CryptoSerializableAsync {
1275
+ let CryptoCipher = CryptoCipher_1 = class CryptoCipher extends CryptoSerializable_1.CryptoSerializable {
1281
1276
  constructor(cipher, algorithm, nonce, counter) {
1282
1277
  if (!nonce && typeof counter === "undefined") {
1283
1278
  throw new CryptoError_1.CryptoError(CryptoErrorCode_1.CryptoErrorCode.EncryptionNoNonceNorCounter, "No nonce nor counter property set.");
@@ -1321,7 +1316,7 @@ let CryptoCipher = CryptoCipher_1 = class CryptoCipher extends CryptoSerializabl
1321
1316
  this.nonce.clear();
1322
1317
  }
1323
1318
  static from(value) {
1324
- return Promise.resolve(new CryptoCipher_1(CoreBuffer_1.CoreBuffer.from(value.cipher), value.algorithm, CoreBuffer_1.CoreBuffer.from(value.nonce), value.counter));
1319
+ return new CryptoCipher_1(CoreBuffer_1.CoreBuffer.from(value.cipher), value.algorithm, CoreBuffer_1.CoreBuffer.from(value.nonce), value.counter);
1325
1320
  }
1326
1321
  static fromJSON(value) {
1327
1322
  CryptoValidation_1.CryptoValidation.checkObject(value);
@@ -1338,14 +1333,14 @@ let CryptoCipher = CryptoCipher_1 = class CryptoCipher extends CryptoSerializabl
1338
1333
  }
1339
1334
  CryptoValidation_1.CryptoValidation.checkSerializedBuffer(value.cph, this.MIN_CIPHER_BYTES, this.MAX_CIPHER_BYTES, "cipher");
1340
1335
  const cipherBuffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.cph);
1341
- return Promise.resolve(new CryptoCipher_1(cipherBuffer, value.alg, nonceBuffer, counter));
1336
+ return new CryptoCipher_1(cipherBuffer, value.alg, nonceBuffer, counter);
1342
1337
  }
1343
- static async fromBase64(value) {
1344
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
1338
+ static fromBase64(value) {
1339
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
1345
1340
  }
1346
- static async deserialize(value) {
1341
+ static deserialize(value) {
1347
1342
  const obj = JSON.parse(value);
1348
- return await this.fromJSON(obj);
1343
+ return this.fromJSON(obj);
1349
1344
  }
1350
1345
  };
1351
1346
  CryptoCipher.MIN_CIPHER_BYTES = 2;
@@ -1603,9 +1598,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
1603
1598
  exports.CryptoSecretKey = void 0;
1604
1599
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
1605
1600
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
1606
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ../CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
1601
+ const CryptoSerializable_1 = __webpack_require__(/*! ../CryptoSerializable */ "./dist/CryptoSerializable.js");
1607
1602
  const CryptoValidation_1 = __webpack_require__(/*! ../CryptoValidation */ "./dist/CryptoValidation.js");
1608
- let CryptoSecretKey = CryptoSecretKey_1 = class CryptoSecretKey extends CryptoSerializableAsync_1.CryptoSerializableAsync {
1603
+ let CryptoSecretKey = CryptoSecretKey_1 = class CryptoSecretKey extends CryptoSerializable_1.CryptoSerializable {
1609
1604
  constructor(secretKey, algorithm = 3 /* XCHACHA20_POLY1305 */) {
1610
1605
  CryptoValidation_1.CryptoValidation.checkEncryptionAlgorithm(algorithm);
1611
1606
  CryptoValidation_1.CryptoValidation.checkSecretKeyForAlgorithm(secretKey, algorithm);
@@ -1627,13 +1622,13 @@ let CryptoSecretKey = CryptoSecretKey_1 = class CryptoSecretKey extends CryptoSe
1627
1622
  this.secretKey.clear();
1628
1623
  }
1629
1624
  static from(value) {
1630
- return Promise.resolve(new CryptoSecretKey_1(CoreBuffer_1.CoreBuffer.from(value.secretKey), value.algorithm));
1625
+ return new CryptoSecretKey_1(CoreBuffer_1.CoreBuffer.from(value.secretKey), value.algorithm);
1631
1626
  }
1632
- static async fromJSON(value) {
1627
+ static fromJSON(value) {
1633
1628
  CryptoValidation_1.CryptoValidation.checkEncryptionAlgorithm(value.alg);
1634
1629
  CryptoValidation_1.CryptoValidation.checkSerializedSecretKeyForAlgorithm(value.key, value.alg);
1635
1630
  const buffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.key);
1636
- return await this.from({
1631
+ return this.from({
1637
1632
  algorithm: value.alg,
1638
1633
  secretKey: buffer
1639
1634
  });
@@ -1641,9 +1636,9 @@ let CryptoSecretKey = CryptoSecretKey_1 = class CryptoSecretKey extends CryptoSe
1641
1636
  static fromBase64(value) {
1642
1637
  return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
1643
1638
  }
1644
- static async deserialize(value) {
1639
+ static deserialize(value) {
1645
1640
  const obj = JSON.parse(value);
1646
- return await this.fromJSON(obj);
1641
+ return this.fromJSON(obj);
1647
1642
  }
1648
1643
  };
1649
1644
  CryptoSecretKey = CryptoSecretKey_1 = __decorate([
@@ -1679,7 +1674,7 @@ class CryptoExchange {
1679
1674
  case 3 /* ECDH_X25519 */:
1680
1675
  try {
1681
1676
  const publicKey = (await SodiumWrapper_1.SodiumWrapper.ready()).crypto_scalarmult_base(privateKey.privateKey.buffer);
1682
- return await CryptoExchangePublicKey_1.CryptoExchangePublicKey.from({
1677
+ return CryptoExchangePublicKey_1.CryptoExchangePublicKey.from({
1683
1678
  algorithm: privateKey.algorithm,
1684
1679
  publicKey: CoreBuffer_1.CoreBuffer.from(publicKey)
1685
1680
  });
@@ -1744,7 +1739,7 @@ class CryptoExchange {
1744
1739
  catch (e) {
1745
1740
  throw new CryptoError_1.CryptoError(CryptoErrorCode_1.CryptoErrorCode.ExchangeKeyDerivation, `${e}`);
1746
1741
  }
1747
- const secrets = await CryptoExchangeSecrets_1.CryptoExchangeSecrets.from({
1742
+ const secrets = CryptoExchangeSecrets_1.CryptoExchangeSecrets.from({
1748
1743
  receivingKey: CoreBuffer_1.CoreBuffer.from(sharedKey.sharedRx),
1749
1744
  transmissionKey: CoreBuffer_1.CoreBuffer.from(sharedKey.sharedTx),
1750
1745
  algorithm: algorithm
@@ -1775,7 +1770,7 @@ class CryptoExchange {
1775
1770
  catch (e) {
1776
1771
  throw new CryptoError_1.CryptoError(CryptoErrorCode_1.CryptoErrorCode.ExchangeKeyDerivation, `${e}`);
1777
1772
  }
1778
- const secrets = await CryptoExchangeSecrets_1.CryptoExchangeSecrets.from({
1773
+ const secrets = CryptoExchangeSecrets_1.CryptoExchangeSecrets.from({
1779
1774
  receivingKey: CoreBuffer_1.CoreBuffer.from(sharedKey.sharedRx),
1780
1775
  transmissionKey: CoreBuffer_1.CoreBuffer.from(sharedKey.sharedTx),
1781
1776
  algorithm: algorithm
@@ -1810,11 +1805,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
1810
1805
  exports.CryptoExchangeKeypair = void 0;
1811
1806
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
1812
1807
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
1813
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ../CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
1808
+ const CryptoSerializable_1 = __webpack_require__(/*! ../CryptoSerializable */ "./dist/CryptoSerializable.js");
1814
1809
  const CryptoExchangePrivateKey_1 = __webpack_require__(/*! ./CryptoExchangePrivateKey */ "./dist/exchange/CryptoExchangePrivateKey.js");
1815
1810
  const CryptoExchangePublicKey_1 = __webpack_require__(/*! ./CryptoExchangePublicKey */ "./dist/exchange/CryptoExchangePublicKey.js");
1816
1811
  const CryptoExchangeValidation_1 = __webpack_require__(/*! ./CryptoExchangeValidation */ "./dist/exchange/CryptoExchangeValidation.js");
1817
- let CryptoExchangeKeypair = CryptoExchangeKeypair_1 = class CryptoExchangeKeypair extends CryptoSerializableAsync_1.CryptoSerializableAsync {
1812
+ let CryptoExchangeKeypair = CryptoExchangeKeypair_1 = class CryptoExchangeKeypair extends CryptoSerializable_1.CryptoSerializable {
1818
1813
  constructor(publicKey, privateKey) {
1819
1814
  CryptoExchangeValidation_1.CryptoExchangeValidation.checkExchangeKeypair(privateKey, publicKey);
1820
1815
  super();
@@ -1835,26 +1830,22 @@ let CryptoExchangeKeypair = CryptoExchangeKeypair_1 = class CryptoExchangeKeypai
1835
1830
  this.publicKey.clear();
1836
1831
  this.privateKey.clear();
1837
1832
  }
1838
- static async from(value) {
1839
- const [privateKey, publicKey] = await Promise.all([
1840
- CryptoExchangePrivateKey_1.CryptoExchangePrivateKey.from(value.privateKey),
1841
- CryptoExchangePublicKey_1.CryptoExchangePublicKey.from(value.publicKey)
1842
- ]);
1833
+ static from(value) {
1834
+ const privateKey = CryptoExchangePrivateKey_1.CryptoExchangePrivateKey.from(value.privateKey);
1835
+ const publicKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.from(value.publicKey);
1843
1836
  return new CryptoExchangeKeypair_1(publicKey, privateKey);
1844
1837
  }
1845
- static async fromJSON(value) {
1846
- const [privateKey, publicKey] = await Promise.all([
1847
- CryptoExchangePrivateKey_1.CryptoExchangePrivateKey.fromJSON(value.prv),
1848
- CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.pub)
1849
- ]);
1838
+ static fromJSON(value) {
1839
+ const privateKey = CryptoExchangePrivateKey_1.CryptoExchangePrivateKey.fromJSON(value.prv);
1840
+ const publicKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.pub);
1850
1841
  return new CryptoExchangeKeypair_1(publicKey, privateKey);
1851
1842
  }
1852
- static async fromBase64(value) {
1853
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
1843
+ static fromBase64(value) {
1844
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
1854
1845
  }
1855
- static async deserialize(value) {
1846
+ static deserialize(value) {
1856
1847
  const obj = JSON.parse(value);
1857
- return await this.fromJSON(obj);
1848
+ return this.fromJSON(obj);
1858
1849
  }
1859
1850
  };
1860
1851
  CryptoExchangeKeypair = CryptoExchangeKeypair_1 = __decorate([
@@ -1922,19 +1913,19 @@ let CryptoExchangePrivateKey = CryptoExchangePrivateKey_1 = class CryptoExchange
1922
1913
  return await CryptoExchange_1.CryptoExchange.privateKeyToPublicKey(this);
1923
1914
  }
1924
1915
  static from(value) {
1925
- return Promise.resolve(new CryptoExchangePrivateKey_1(value.algorithm, CoreBuffer_1.CoreBuffer.from(value.privateKey)));
1916
+ return new CryptoExchangePrivateKey_1(value.algorithm, CoreBuffer_1.CoreBuffer.from(value.privateKey));
1926
1917
  }
1927
1918
  static fromJSON(value) {
1928
1919
  CryptoExchangeValidation_1.CryptoExchangeValidation.checkExchangeAlgorithm(value.alg);
1929
1920
  CryptoExchangeValidation_1.CryptoExchangeValidation.checkExchangePrivateKeyAsNumber(value.prv, value.alg, "privateKey");
1930
1921
  const buffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.prv);
1931
- return Promise.resolve(new CryptoExchangePrivateKey_1(value.alg, buffer));
1922
+ return new CryptoExchangePrivateKey_1(value.alg, buffer);
1932
1923
  }
1933
1924
  static fromBase64(value) {
1934
1925
  return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
1935
1926
  }
1936
- static async deserialize(value) {
1937
- return await this.fromJSON(JSON.parse(value));
1927
+ static deserialize(value) {
1928
+ return this.fromJSON(JSON.parse(value));
1938
1929
  }
1939
1930
  };
1940
1931
  CryptoExchangePrivateKey = CryptoExchangePrivateKey_1 = __decorate([
@@ -1992,23 +1983,23 @@ let CryptoExchangePublicKey = CryptoExchangePublicKey_1 = class CryptoExchangePu
1992
1983
  this.publicKey.clear();
1993
1984
  }
1994
1985
  static from(value) {
1995
- return Promise.resolve(new CryptoExchangePublicKey_1(value.algorithm, value.publicKey));
1986
+ return new CryptoExchangePublicKey_1(value.algorithm, value.publicKey);
1996
1987
  }
1997
- static async fromJSON(value) {
1988
+ static fromJSON(value) {
1998
1989
  CryptoExchangeValidation_1.CryptoExchangeValidation.checkExchangeAlgorithm(value.alg);
1999
1990
  CryptoExchangeValidation_1.CryptoExchangeValidation.checkExchangePrivateKeyAsNumber(value.pub, value.alg, "publicKey");
2000
1991
  const buffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.pub);
2001
- return await this.from({
1992
+ return this.from({
2002
1993
  algorithm: value.alg,
2003
1994
  publicKey: buffer
2004
1995
  });
2005
1996
  }
2006
- static async fromBase64(value) {
2007
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
1997
+ static fromBase64(value) {
1998
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
2008
1999
  }
2009
- static async deserialize(value) {
2000
+ static deserialize(value) {
2010
2001
  const obj = JSON.parse(value);
2011
- return await this.fromJSON(obj);
2002
+ return this.fromJSON(obj);
2012
2003
  }
2013
2004
  };
2014
2005
  CryptoExchangePublicKey = CryptoExchangePublicKey_1 = __decorate([
@@ -2042,8 +2033,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
2042
2033
  exports.CryptoExchangeSecrets = void 0;
2043
2034
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
2044
2035
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
2045
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ../CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
2046
- let CryptoExchangeSecrets = CryptoExchangeSecrets_1 = class CryptoExchangeSecrets extends CryptoSerializableAsync_1.CryptoSerializableAsync {
2036
+ const CryptoSerializable_1 = __webpack_require__(/*! ../CryptoSerializable */ "./dist/CryptoSerializable.js");
2037
+ let CryptoExchangeSecrets = CryptoExchangeSecrets_1 = class CryptoExchangeSecrets extends CryptoSerializable_1.CryptoSerializable {
2047
2038
  constructor(receivingKey, transmissionKey, algorithm) {
2048
2039
  super();
2049
2040
  this.receivingKey = receivingKey;
@@ -2078,7 +2069,7 @@ let CryptoExchangeSecrets = CryptoExchangeSecrets_1 = class CryptoExchangeSecret
2078
2069
  }
2079
2070
  const receivingKey = CoreBuffer_1.CoreBuffer.from(value.receivingKey);
2080
2071
  const transmissionKey = CoreBuffer_1.CoreBuffer.from(value.transmissionKey);
2081
- return Promise.resolve(new CryptoExchangeSecrets_1(receivingKey, transmissionKey, value.algorithm));
2072
+ return new CryptoExchangeSecrets_1(receivingKey, transmissionKey, value.algorithm);
2082
2073
  }
2083
2074
  static fromJSON(value) {
2084
2075
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
@@ -2087,14 +2078,14 @@ let CryptoExchangeSecrets = CryptoExchangeSecrets_1 = class CryptoExchangeSecret
2087
2078
  }
2088
2079
  const receivingKey = CoreBuffer_1.CoreBuffer.fromBase64URL(value.rx);
2089
2080
  const transmissionKey = CoreBuffer_1.CoreBuffer.fromBase64URL(value.tx);
2090
- return Promise.resolve(new CryptoExchangeSecrets_1(receivingKey, transmissionKey, value.alg));
2081
+ return new CryptoExchangeSecrets_1(receivingKey, transmissionKey, value.alg);
2091
2082
  }
2092
2083
  static fromBase64(value) {
2093
2084
  return Promise.resolve(this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value)));
2094
2085
  }
2095
- static async deserialize(value) {
2086
+ static deserialize(value) {
2096
2087
  const obj = JSON.parse(value);
2097
- return await this.fromJSON(obj);
2088
+ return this.fromJSON(obj);
2098
2089
  }
2099
2090
  };
2100
2091
  CryptoExchangeSecrets = CryptoExchangeSecrets_1 = __decorate([
@@ -2308,7 +2299,11 @@ exports.CryptoHash = CryptoHash;
2308
2299
 
2309
2300
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2310
2301
  if (k2 === undefined) k2 = k;
2311
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2302
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2303
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2304
+ desc = { enumerable: true, get: function() { return m[k]; } };
2305
+ }
2306
+ Object.defineProperty(o, k2, desc);
2312
2307
  }) : (function(o, m, k, k2) {
2313
2308
  if (k2 === undefined) k2 = k;
2314
2309
  o[k2] = m[k];
@@ -2747,10 +2742,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
2747
2742
  exports.CryptoRelationshipPublicRequest = void 0;
2748
2743
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
2749
2744
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
2750
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ../CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
2745
+ const CryptoSerializable_1 = __webpack_require__(/*! ../CryptoSerializable */ "./dist/CryptoSerializable.js");
2751
2746
  const CryptoExchangePublicKey_1 = __webpack_require__(/*! ../exchange/CryptoExchangePublicKey */ "./dist/exchange/CryptoExchangePublicKey.js");
2752
2747
  const CryptoSignaturePublicKey_1 = __webpack_require__(/*! ../signature/CryptoSignaturePublicKey */ "./dist/signature/CryptoSignaturePublicKey.js");
2753
- let CryptoRelationshipPublicRequest = CryptoRelationshipPublicRequest_1 = class CryptoRelationshipPublicRequest extends CryptoSerializableAsync_1.CryptoSerializableAsync {
2748
+ let CryptoRelationshipPublicRequest = CryptoRelationshipPublicRequest_1 = class CryptoRelationshipPublicRequest extends CryptoSerializable_1.CryptoSerializable {
2754
2749
  constructor(signatureKey, exchangeKey, ephemeralKey, nonce) {
2755
2750
  super();
2756
2751
  this.signatureKey = signatureKey;
@@ -2776,29 +2771,25 @@ let CryptoRelationshipPublicRequest = CryptoRelationshipPublicRequest_1 = class
2776
2771
  this.ephemeralKey.clear();
2777
2772
  this.nonce.clear();
2778
2773
  }
2779
- static async from(value) {
2780
- const [signatureKey, exchangeKey, ephemeralKey, nonce] = await Promise.all([
2781
- CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.from(value.signatureKey),
2782
- CryptoExchangePublicKey_1.CryptoExchangePublicKey.from(value.exchangeKey),
2783
- CryptoExchangePublicKey_1.CryptoExchangePublicKey.from(value.ephemeralKey),
2784
- CoreBuffer_1.CoreBuffer.from(value.nonce)
2785
- ]);
2774
+ static from(value) {
2775
+ const signatureKey = CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.from(value.signatureKey);
2776
+ const exchangeKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.from(value.exchangeKey);
2777
+ const ephemeralKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.from(value.ephemeralKey);
2778
+ const nonce = CoreBuffer_1.CoreBuffer.from(value.nonce);
2786
2779
  return new CryptoRelationshipPublicRequest_1(signatureKey, exchangeKey, ephemeralKey, nonce);
2787
2780
  }
2788
- static async fromJSON(value) {
2789
- const [signatureKey, exchangeKey, ephemeralKey, nonce] = await Promise.all([
2790
- CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.fromJSON(value.sig),
2791
- CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.exc),
2792
- CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.eph),
2793
- CoreBuffer_1.CoreBuffer.fromBase64URL(value.nnc)
2794
- ]);
2781
+ static fromJSON(value) {
2782
+ const signatureKey = CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.fromJSON(value.sig);
2783
+ const exchangeKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.exc);
2784
+ const ephemeralKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.eph);
2785
+ const nonce = CoreBuffer_1.CoreBuffer.fromBase64URL(value.nnc);
2795
2786
  return new CryptoRelationshipPublicRequest_1(signatureKey, exchangeKey, ephemeralKey, nonce);
2796
2787
  }
2797
- static async fromBase64(value) {
2798
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
2788
+ static fromBase64(value) {
2789
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
2799
2790
  }
2800
- static async deserialize(value) {
2801
- return await this.fromJSON(JSON.parse(value));
2791
+ static deserialize(value) {
2792
+ return this.fromJSON(JSON.parse(value));
2802
2793
  }
2803
2794
  };
2804
2795
  __decorate([
@@ -2860,12 +2851,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
2860
2851
  exports.CryptoRelationshipPublicResponse = void 0;
2861
2852
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
2862
2853
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
2863
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ../CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
2854
+ const CryptoSerializable_1 = __webpack_require__(/*! ../CryptoSerializable */ "./dist/CryptoSerializable.js");
2864
2855
  const CryptoExchangePublicKey_1 = __webpack_require__(/*! ../exchange/CryptoExchangePublicKey */ "./dist/exchange/CryptoExchangePublicKey.js");
2865
2856
  const CryptoSignaturePublicKey_1 = __webpack_require__(/*! ../signature/CryptoSignaturePublicKey */ "./dist/signature/CryptoSignaturePublicKey.js");
2866
2857
  const CryptoSignatures_1 = __webpack_require__(/*! ../signature/CryptoSignatures */ "./dist/signature/CryptoSignatures.js");
2867
2858
  const CryptoPublicState_1 = __webpack_require__(/*! ../state/CryptoPublicState */ "./dist/state/CryptoPublicState.js");
2868
- let CryptoRelationshipPublicResponse = CryptoRelationshipPublicResponse_1 = class CryptoRelationshipPublicResponse extends CryptoSerializableAsync_1.CryptoSerializableAsync {
2859
+ let CryptoRelationshipPublicResponse = CryptoRelationshipPublicResponse_1 = class CryptoRelationshipPublicResponse extends CryptoSerializable_1.CryptoSerializable {
2869
2860
  constructor(signatureKey, exchangeKey, state) {
2870
2861
  super();
2871
2862
  this.signatureKey = signatureKey;
@@ -2891,27 +2882,23 @@ let CryptoRelationshipPublicResponse = CryptoRelationshipPublicResponse_1 = clas
2891
2882
  async verify(content, signature) {
2892
2883
  return await CryptoSignatures_1.CryptoSignatures.verify(content, signature, this.signatureKey);
2893
2884
  }
2894
- static async from(value) {
2895
- const [signatureKey, exchangeKey, state] = await Promise.all([
2896
- CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.from(value.signatureKey),
2897
- CryptoExchangePublicKey_1.CryptoExchangePublicKey.from(value.exchangeKey),
2898
- CryptoPublicState_1.CryptoPublicState.from(value.state)
2899
- ]);
2885
+ static from(value) {
2886
+ const signatureKey = CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.from(value.signatureKey);
2887
+ const exchangeKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.from(value.exchangeKey);
2888
+ const state = CryptoPublicState_1.CryptoPublicState.from(value.state);
2900
2889
  return new CryptoRelationshipPublicResponse_1(signatureKey, exchangeKey, state);
2901
2890
  }
2902
- static async fromJSON(value) {
2903
- const [signatureKey, exchangeKey, state] = await Promise.all([
2904
- CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.fromJSON(value.sig),
2905
- CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.exc),
2906
- CryptoPublicState_1.CryptoPublicState.fromJSON(value.sta)
2907
- ]);
2891
+ static fromJSON(value) {
2892
+ const signatureKey = CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.fromJSON(value.sig);
2893
+ const exchangeKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.exc);
2894
+ const state = CryptoPublicState_1.CryptoPublicState.fromJSON(value.sta);
2908
2895
  return new CryptoRelationshipPublicResponse_1(signatureKey, exchangeKey, state);
2909
2896
  }
2910
- static async fromBase64(value) {
2911
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
2897
+ static fromBase64(value) {
2898
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
2912
2899
  }
2913
- static async deserialize(value) {
2914
- return await this.fromJSON(JSON.parse(value));
2900
+ static deserialize(value) {
2901
+ return this.fromJSON(JSON.parse(value));
2915
2902
  }
2916
2903
  };
2917
2904
  __decorate([
@@ -2968,7 +2955,7 @@ exports.CryptoRelationshipRequestSecrets = void 0;
2968
2955
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
2969
2956
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
2970
2957
  const CryptoDerivation_1 = __webpack_require__(/*! ../CryptoDerivation */ "./dist/CryptoDerivation.js");
2971
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ../CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
2958
+ const CryptoSerializable_1 = __webpack_require__(/*! ../CryptoSerializable */ "./dist/CryptoSerializable.js");
2972
2959
  const CryptoEncryption_1 = __webpack_require__(/*! ../encryption/CryptoEncryption */ "./dist/encryption/CryptoEncryption.js");
2973
2960
  const CryptoSecretKey_1 = __webpack_require__(/*! ../encryption/CryptoSecretKey */ "./dist/encryption/CryptoSecretKey.js");
2974
2961
  const CryptoExchange_1 = __webpack_require__(/*! ../exchange/CryptoExchange */ "./dist/exchange/CryptoExchange.js");
@@ -2979,12 +2966,12 @@ const CryptoSignatureKeypair_1 = __webpack_require__(/*! ../signature/CryptoSign
2979
2966
  const CryptoSignaturePublicKey_1 = __webpack_require__(/*! ../signature/CryptoSignaturePublicKey */ "./dist/signature/CryptoSignaturePublicKey.js");
2980
2967
  const CryptoSignatures_1 = __webpack_require__(/*! ../signature/CryptoSignatures */ "./dist/signature/CryptoSignatures.js");
2981
2968
  const CryptoRelationshipPublicRequest_1 = __webpack_require__(/*! ./CryptoRelationshipPublicRequest */ "./dist/relationship/CryptoRelationshipPublicRequest.js");
2982
- let CryptoRelationshipRequestSecrets = CryptoRelationshipRequestSecrets_1 = class CryptoRelationshipRequestSecrets extends CryptoSerializableAsync_1.CryptoSerializableAsync {
2983
- static async from(value) {
2984
- return (await super.from(value, CryptoRelationshipRequestSecrets_1));
2969
+ let CryptoRelationshipRequestSecrets = CryptoRelationshipRequestSecrets_1 = class CryptoRelationshipRequestSecrets extends CryptoSerializable_1.CryptoSerializable {
2970
+ static from(value) {
2971
+ return super.from(value, CryptoRelationshipRequestSecrets_1);
2985
2972
  }
2986
- static async deserialize(value) {
2987
- return (await super.deserialize(value, CryptoRelationshipRequestSecrets_1));
2973
+ static deserialize(value) {
2974
+ return super.deserialize(value, CryptoRelationshipRequestSecrets_1);
2988
2975
  }
2989
2976
  async sign(content, algorithm = 1 /* SHA256 */) {
2990
2977
  return await CryptoSignatures_1.CryptoSignatures.sign(content, this.signatureKeypair.privateKey, algorithm);
@@ -3001,8 +2988,8 @@ let CryptoRelationshipRequestSecrets = CryptoRelationshipRequestSecrets_1 = clas
3001
2988
  async decryptRequest(cipher) {
3002
2989
  return await CryptoEncryption_1.CryptoEncryption.decrypt(cipher, this.secretKey);
3003
2990
  }
3004
- async toPublicRequest() {
3005
- return await CryptoRelationshipPublicRequest_1.CryptoRelationshipPublicRequest.from({
2991
+ toPublicRequest() {
2992
+ return CryptoRelationshipPublicRequest_1.CryptoRelationshipPublicRequest.from({
3006
2993
  id: this.id,
3007
2994
  exchangeKey: this.exchangeKeypair.publicKey,
3008
2995
  signatureKey: this.signatureKeypair.publicKey,
@@ -3019,7 +3006,7 @@ let CryptoRelationshipRequestSecrets = CryptoRelationshipRequestSecrets_1 = clas
3019
3006
  ]);
3020
3007
  const masterKey = await CryptoExchange_1.CryptoExchange.deriveRequestor(ephemeralKeypair, peerExchangeKey);
3021
3008
  const secretKey = await CryptoDerivation_1.CryptoDerivation.deriveKeyFromBase(masterKey.transmissionKey, 1, "REQTMP01");
3022
- return await CryptoRelationshipRequestSecrets_1.from({
3009
+ return CryptoRelationshipRequestSecrets_1.from({
3023
3010
  exchangeKeypair: exchangeKeypair,
3024
3011
  ephemeralKeypair: ephemeralKeypair,
3025
3012
  signatureKeypair: signatureKeypair,
@@ -3102,7 +3089,7 @@ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-s
3102
3089
  const CryptoDerivation_1 = __webpack_require__(/*! ../CryptoDerivation */ "./dist/CryptoDerivation.js");
3103
3090
  const CryptoError_1 = __webpack_require__(/*! ../CryptoError */ "./dist/CryptoError.js");
3104
3091
  const CryptoErrorCode_1 = __webpack_require__(/*! ../CryptoErrorCode */ "./dist/CryptoErrorCode.js");
3105
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ../CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
3092
+ const CryptoSerializable_1 = __webpack_require__(/*! ../CryptoSerializable */ "./dist/CryptoSerializable.js");
3106
3093
  const CryptoEncryption_1 = __webpack_require__(/*! ../encryption/CryptoEncryption */ "./dist/encryption/CryptoEncryption.js");
3107
3094
  const CryptoSecretKey_1 = __webpack_require__(/*! ../encryption/CryptoSecretKey */ "./dist/encryption/CryptoSecretKey.js");
3108
3095
  const CryptoExchange_1 = __webpack_require__(/*! ../exchange/CryptoExchange */ "./dist/exchange/CryptoExchange.js");
@@ -3116,12 +3103,12 @@ const CryptoPrivateStateTransmit_1 = __webpack_require__(/*! ../state/CryptoPriv
3116
3103
  const CryptoStateType_1 = __webpack_require__(/*! ../state/CryptoStateType */ "./dist/state/CryptoStateType.js");
3117
3104
  const CryptoRelationshipPublicResponse_1 = __webpack_require__(/*! ./CryptoRelationshipPublicResponse */ "./dist/relationship/CryptoRelationshipPublicResponse.js");
3118
3105
  const CryptoRelationshipType_1 = __webpack_require__(/*! ./CryptoRelationshipType */ "./dist/relationship/CryptoRelationshipType.js");
3119
- let CryptoRelationshipSecrets = CryptoRelationshipSecrets_1 = class CryptoRelationshipSecrets extends CryptoSerializableAsync_1.CryptoSerializableAsync {
3120
- static async from(value) {
3121
- return (await super.from(value, CryptoRelationshipSecrets_1));
3106
+ let CryptoRelationshipSecrets = CryptoRelationshipSecrets_1 = class CryptoRelationshipSecrets extends CryptoSerializable_1.CryptoSerializable {
3107
+ static from(value) {
3108
+ return super.from(value, CryptoRelationshipSecrets_1);
3122
3109
  }
3123
- static async deserialize(value) {
3124
- return (await super.deserialize(value, CryptoRelationshipSecrets_1));
3110
+ static deserialize(value) {
3111
+ return super.deserialize(value, CryptoRelationshipSecrets_1);
3125
3112
  }
3126
3113
  async sign(content, algorithm = 1 /* SHA256 */) {
3127
3114
  return await CryptoSignatures_1.CryptoSignatures.sign(content, this.signatureKeypair.privateKey, algorithm);
@@ -3150,8 +3137,8 @@ let CryptoRelationshipSecrets = CryptoRelationshipSecrets_1 = class CryptoRelati
3150
3137
  async decryptRequest(cipher) {
3151
3138
  return await CryptoEncryption_1.CryptoEncryption.decrypt(cipher, this.requestSecretKey);
3152
3139
  }
3153
- async toPublicResponse() {
3154
- return await CryptoRelationshipPublicResponse_1.CryptoRelationshipPublicResponse.from({
3140
+ toPublicResponse() {
3141
+ return CryptoRelationshipPublicResponse_1.CryptoRelationshipPublicResponse.from({
3155
3142
  exchangeKey: this.exchangeKeypair.publicKey,
3156
3143
  signatureKey: this.signatureKeypair.publicKey,
3157
3144
  state: this.transmitState.toPublicState()
@@ -3182,7 +3169,7 @@ let CryptoRelationshipSecrets = CryptoRelationshipSecrets_1 = class CryptoRelati
3182
3169
  stateType: CryptoStateType_1.CryptoStateType.Transmit
3183
3170
  })
3184
3171
  ]);
3185
- return await CryptoRelationshipSecrets_1.from({
3172
+ return CryptoRelationshipSecrets_1.from({
3186
3173
  exchangeKeypair: exchangeKeypair,
3187
3174
  signatureKeypair: signatureKeypair,
3188
3175
  receiveState: receiveState,
@@ -3227,7 +3214,7 @@ let CryptoRelationshipSecrets = CryptoRelationshipSecrets_1 = class CryptoRelati
3227
3214
  ]);
3228
3215
  const masterKey = await CryptoExchange_1.CryptoExchange.deriveTemplator(templateExchangeKeypair, peerTemplateKey);
3229
3216
  const secretKey = await CryptoDerivation_1.CryptoDerivation.deriveKeyFromBase(masterKey.receivingKey, 1, "REQTMP01");
3230
- return await CryptoRelationshipSecrets_1.from({
3217
+ return CryptoRelationshipSecrets_1.from({
3231
3218
  exchangeKeypair: exchangeKeypair,
3232
3219
  signatureKeypair: signatureKeypair,
3233
3220
  receiveState: receiveState,
@@ -3345,9 +3332,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3345
3332
  exports.CryptoSignature = void 0;
3346
3333
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
3347
3334
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
3348
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ../CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
3335
+ const CryptoSerializable_1 = __webpack_require__(/*! ../CryptoSerializable */ "./dist/CryptoSerializable.js");
3349
3336
  const CryptoSignatureValidation_1 = __webpack_require__(/*! ./CryptoSignatureValidation */ "./dist/signature/CryptoSignatureValidation.js");
3350
- let CryptoSignature = CryptoSignature_1 = class CryptoSignature extends CryptoSerializableAsync_1.CryptoSerializableAsync {
3337
+ let CryptoSignature = CryptoSignature_1 = class CryptoSignature extends CryptoSerializable_1.CryptoSerializable {
3351
3338
  constructor(signature, algorithm, keyId, id) {
3352
3339
  let error;
3353
3340
  error = CryptoSignatureValidation_1.CryptoSignatureValidation.checkHashAlgorithm(algorithm);
@@ -3376,7 +3363,7 @@ let CryptoSignature = CryptoSignature_1 = class CryptoSignature extends CryptoSe
3376
3363
  this.signature.clear();
3377
3364
  }
3378
3365
  static from(value) {
3379
- return Promise.resolve(new CryptoSignature_1(value.signature, value.algorithm));
3366
+ return new CryptoSignature_1(value.signature, value.algorithm);
3380
3367
  }
3381
3368
  static fromJSON(value) {
3382
3369
  let error = CryptoSignatureValidation_1.CryptoSignatureValidation.checkHashAlgorithm(value.alg);
@@ -3386,14 +3373,14 @@ let CryptoSignature = CryptoSignature_1 = class CryptoSignature extends CryptoSe
3386
3373
  if (error)
3387
3374
  throw error;
3388
3375
  const buffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.sig);
3389
- return Promise.resolve(new CryptoSignature_1(buffer, value.alg));
3376
+ return new CryptoSignature_1(buffer, value.alg);
3390
3377
  }
3391
- static async fromBase64(value) {
3392
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
3378
+ static fromBase64(value) {
3379
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
3393
3380
  }
3394
- static async deserialize(value) {
3381
+ static deserialize(value) {
3395
3382
  const obj = JSON.parse(value);
3396
- return await this.fromJSON(obj);
3383
+ return this.fromJSON(obj);
3397
3384
  }
3398
3385
  };
3399
3386
  CryptoSignature = CryptoSignature_1 = __decorate([
@@ -3427,11 +3414,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3427
3414
  exports.CryptoSignatureKeypair = void 0;
3428
3415
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
3429
3416
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
3430
- const CryptoSerializableAsync_1 = __webpack_require__(/*! ../CryptoSerializableAsync */ "./dist/CryptoSerializableAsync.js");
3417
+ const CryptoSerializable_1 = __webpack_require__(/*! ../CryptoSerializable */ "./dist/CryptoSerializable.js");
3431
3418
  const CryptoSignaturePrivateKey_1 = __webpack_require__(/*! ./CryptoSignaturePrivateKey */ "./dist/signature/CryptoSignaturePrivateKey.js");
3432
3419
  const CryptoSignaturePublicKey_1 = __webpack_require__(/*! ./CryptoSignaturePublicKey */ "./dist/signature/CryptoSignaturePublicKey.js");
3433
3420
  const CryptoSignatureValidation_1 = __webpack_require__(/*! ./CryptoSignatureValidation */ "./dist/signature/CryptoSignatureValidation.js");
3434
- let CryptoSignatureKeypair = CryptoSignatureKeypair_1 = class CryptoSignatureKeypair extends CryptoSerializableAsync_1.CryptoSerializableAsync {
3421
+ let CryptoSignatureKeypair = CryptoSignatureKeypair_1 = class CryptoSignatureKeypair extends CryptoSerializable_1.CryptoSerializable {
3435
3422
  constructor(publicKey, privateKey) {
3436
3423
  const error = CryptoSignatureValidation_1.CryptoSignatureValidation.checkSignatureKeypair(privateKey, publicKey);
3437
3424
  if (error)
@@ -3454,26 +3441,22 @@ let CryptoSignatureKeypair = CryptoSignatureKeypair_1 = class CryptoSignatureKey
3454
3441
  this.publicKey.clear();
3455
3442
  this.privateKey.clear();
3456
3443
  }
3457
- static async from(value) {
3458
- const [privateKey, publicKey] = await Promise.all([
3459
- CryptoSignaturePrivateKey_1.CryptoSignaturePrivateKey.from(value.privateKey),
3460
- CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.from(value.publicKey)
3461
- ]);
3444
+ static from(value) {
3445
+ const privateKey = CryptoSignaturePrivateKey_1.CryptoSignaturePrivateKey.from(value.privateKey);
3446
+ const publicKey = CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.from(value.publicKey);
3462
3447
  return new CryptoSignatureKeypair_1(publicKey, privateKey);
3463
3448
  }
3464
- static async fromJSON(value) {
3465
- const [privateKey, publicKey] = await Promise.all([
3466
- CryptoSignaturePrivateKey_1.CryptoSignaturePrivateKey.fromJSON(value.prv),
3467
- CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.fromJSON(value.pub)
3468
- ]);
3449
+ static fromJSON(value) {
3450
+ const privateKey = CryptoSignaturePrivateKey_1.CryptoSignaturePrivateKey.fromJSON(value.prv);
3451
+ const publicKey = CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.fromJSON(value.pub);
3469
3452
  return new CryptoSignatureKeypair_1(publicKey, privateKey);
3470
3453
  }
3471
- static async fromBase64(value) {
3472
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
3454
+ static fromBase64(value) {
3455
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
3473
3456
  }
3474
- static async deserialize(value) {
3457
+ static deserialize(value) {
3475
3458
  const obj = JSON.parse(value);
3476
- return await this.fromJSON(obj);
3459
+ return this.fromJSON(obj);
3477
3460
  }
3478
3461
  };
3479
3462
  CryptoSignatureKeypair = CryptoSignatureKeypair_1 = __decorate([
@@ -3542,7 +3525,7 @@ let CryptoSignaturePrivateKey = CryptoSignaturePrivateKey_1 = class CryptoSignat
3542
3525
  return await CryptoSignatures_1.CryptoSignatures.privateKeyToPublicKey(this);
3543
3526
  }
3544
3527
  static from(value) {
3545
- return Promise.resolve(new CryptoSignaturePrivateKey_1(value.algorithm, CoreBuffer_1.CoreBuffer.from(value.privateKey)));
3528
+ return new CryptoSignaturePrivateKey_1(value.algorithm, CoreBuffer_1.CoreBuffer.from(value.privateKey));
3546
3529
  }
3547
3530
  static fromJSON(value) {
3548
3531
  let error;
@@ -3553,13 +3536,13 @@ let CryptoSignaturePrivateKey = CryptoSignaturePrivateKey_1 = class CryptoSignat
3553
3536
  if (error)
3554
3537
  throw error;
3555
3538
  const buffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.prv);
3556
- return Promise.resolve(new CryptoSignaturePrivateKey_1(value.alg, buffer));
3539
+ return new CryptoSignaturePrivateKey_1(value.alg, buffer);
3557
3540
  }
3558
- static async fromBase64(value) {
3559
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
3541
+ static fromBase64(value) {
3542
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
3560
3543
  }
3561
- static async deserialize(value) {
3562
- return await this.fromJSON(JSON.parse(value));
3544
+ static deserialize(value) {
3545
+ return this.fromJSON(JSON.parse(value));
3563
3546
  }
3564
3547
  };
3565
3548
  CryptoSignaturePrivateKey = CryptoSignaturePrivateKey_1 = __decorate([
@@ -3623,9 +3606,9 @@ let CryptoSignaturePublicKey = CryptoSignaturePublicKey_1 = class CryptoSignatur
3623
3606
  return CoreBuffer_1.CoreBuffer.utf8_base64(this.serialize(verbose));
3624
3607
  }
3625
3608
  static from(value) {
3626
- return Promise.resolve(new CryptoSignaturePublicKey_1(value.algorithm, CoreBuffer_1.CoreBuffer.from(value.publicKey)));
3609
+ return new CryptoSignaturePublicKey_1(value.algorithm, CoreBuffer_1.CoreBuffer.from(value.publicKey));
3627
3610
  }
3628
- static async fromJSON(value) {
3611
+ static fromJSON(value) {
3629
3612
  let error;
3630
3613
  error = CryptoSignatureValidation_1.CryptoSignatureValidation.checkSignatureAlgorithm(value.alg);
3631
3614
  if (error)
@@ -3634,17 +3617,17 @@ let CryptoSignaturePublicKey = CryptoSignaturePublicKey_1 = class CryptoSignatur
3634
3617
  if (error)
3635
3618
  throw error;
3636
3619
  const buffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.pub);
3637
- return await this.from({
3620
+ return this.from({
3638
3621
  algorithm: value.alg,
3639
3622
  publicKey: buffer
3640
3623
  });
3641
3624
  }
3642
- static async fromBase64(value) {
3643
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
3625
+ static fromBase64(value) {
3626
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
3644
3627
  }
3645
- static async deserialize(value) {
3628
+ static deserialize(value) {
3646
3629
  const obj = JSON.parse(value);
3647
- return await this.fromJSON(obj);
3630
+ return this.fromJSON(obj);
3648
3631
  }
3649
3632
  };
3650
3633
  CryptoSignaturePublicKey = CryptoSignaturePublicKey_1 = __decorate([
@@ -3812,7 +3795,7 @@ class CryptoSignatures {
3812
3795
  case 3 /* ECDSA_ED25519 */:
3813
3796
  try {
3814
3797
  const publicKey = (await SodiumWrapper_1.SodiumWrapper.ready()).crypto_sign_ed25519_sk_to_pk(privateKey.privateKey.buffer);
3815
- return await CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.from({
3798
+ return CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.from({
3816
3799
  algorithm: privateKey.algorithm,
3817
3800
  publicKey: CoreBuffer_1.CoreBuffer.from(publicKey)
3818
3801
  });
@@ -3925,7 +3908,7 @@ const CryptoError_1 = __webpack_require__(/*! ../CryptoError */ "./dist/CryptoEr
3925
3908
  const CryptoErrorCode_1 = __webpack_require__(/*! ../CryptoErrorCode */ "./dist/CryptoErrorCode.js");
3926
3909
  const CryptoValidation_1 = __webpack_require__(/*! ../CryptoValidation */ "./dist/CryptoValidation.js");
3927
3910
  const CryptoPublicState_1 = __webpack_require__(/*! ./CryptoPublicState */ "./dist/state/CryptoPublicState.js");
3928
- class CryptoPrivateState extends ts_serval_1.SerializableAsync {
3911
+ class CryptoPrivateState extends ts_serval_1.Serializable {
3929
3912
  constructor(nonce, counter, secretKey, algorithm, stateType, id) {
3930
3913
  CryptoValidation_1.CryptoValidation.checkEncryptionAlgorithm(algorithm);
3931
3914
  CryptoValidation_1.CryptoValidation.checkCounter(counter);
@@ -4006,7 +3989,7 @@ class CryptoPrivateState extends ts_serval_1.SerializableAsync {
4006
3989
  if (typeof obj.counter === "undefined") {
4007
3990
  throw new CryptoError_1.CryptoError(CryptoErrorCode_1.CryptoErrorCode.StateWrongCounter, "Wrong counter.");
4008
3991
  }
4009
- return Promise.resolve(new CryptoPrivateState(CoreBuffer_1.CoreBuffer.from(obj.nonce), obj.counter, CoreBuffer_1.CoreBuffer.from(obj.secretKey), obj.algorithm, obj.stateType, obj.id));
3992
+ return new CryptoPrivateState(CoreBuffer_1.CoreBuffer.from(obj.nonce), obj.counter, CoreBuffer_1.CoreBuffer.from(obj.secretKey), obj.algorithm, obj.stateType, obj.id);
4010
3993
  }
4011
3994
  static fromJSON(value) {
4012
3995
  CryptoValidation_1.CryptoValidation.checkEncryptionAlgorithm(value.alg);
@@ -4018,11 +4001,11 @@ class CryptoPrivateState extends ts_serval_1.SerializableAsync {
4018
4001
  }
4019
4002
  const nonceBuffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.nnc);
4020
4003
  const secretKeyBuffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.key);
4021
- return Promise.resolve(new CryptoPrivateState(nonceBuffer, value.cnt, secretKeyBuffer, value.alg, value.typ, value.id));
4004
+ return new CryptoPrivateState(nonceBuffer, value.cnt, secretKeyBuffer, value.alg, value.typ, value.id);
4022
4005
  }
4023
- static async deserialize(value) {
4006
+ static deserialize(value) {
4024
4007
  const obj = JSON.parse(value);
4025
- return await this.from(obj);
4008
+ return this.from(obj);
4026
4009
  }
4027
4010
  }
4028
4011
  exports.CryptoPrivateState = CryptoPrivateState;
@@ -4106,7 +4089,7 @@ let CryptoPrivateStateReceive = CryptoPrivateStateReceive_1 = class CryptoPrivat
4106
4089
  if (obj.stateType !== CryptoStateType_1.CryptoStateType.Receive) {
4107
4090
  throw new CryptoError_1.CryptoError(CryptoErrorCode_1.CryptoErrorCode.StateWrongType, "The given object has a wrong state type.");
4108
4091
  }
4109
- return Promise.resolve(new CryptoPrivateStateReceive_1(CoreBuffer_1.CoreBuffer.from(obj.nonce), obj.counter, CoreBuffer_1.CoreBuffer.from(obj.secretKey), obj.algorithm, obj.id));
4092
+ return new CryptoPrivateStateReceive_1(CoreBuffer_1.CoreBuffer.from(obj.nonce), obj.counter, CoreBuffer_1.CoreBuffer.from(obj.secretKey), obj.algorithm, obj.id);
4110
4093
  }
4111
4094
  static fromJSON(value) {
4112
4095
  CryptoValidation_1.CryptoValidation.checkEncryptionAlgorithm(value.alg);
@@ -4118,10 +4101,10 @@ let CryptoPrivateStateReceive = CryptoPrivateStateReceive_1 = class CryptoPrivat
4118
4101
  }
4119
4102
  const nonceBuffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.nnc);
4120
4103
  const secretKeyBuffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.key);
4121
- return Promise.resolve(new CryptoPrivateStateReceive_1(nonceBuffer, value.cnt, secretKeyBuffer, value.alg, value.id));
4104
+ return new CryptoPrivateStateReceive_1(nonceBuffer, value.cnt, secretKeyBuffer, value.alg, value.id);
4122
4105
  }
4123
- static async deserialize(value) {
4124
- return await this.fromJSON(JSON.parse(value));
4106
+ static deserialize(value) {
4107
+ return this.fromJSON(JSON.parse(value));
4125
4108
  }
4126
4109
  };
4127
4110
  CryptoPrivateStateReceive = CryptoPrivateStateReceive_1 = __decorate([
@@ -4207,7 +4190,7 @@ let CryptoPrivateStateTransmit = CryptoPrivateStateTransmit_1 = class CryptoPriv
4207
4190
  if (obj.stateType !== CryptoStateType_1.CryptoStateType.Transmit) {
4208
4191
  throw new CryptoError_1.CryptoError(CryptoErrorCode_1.CryptoErrorCode.StateWrongType, "The given object has a wrong state type.");
4209
4192
  }
4210
- return Promise.resolve(new CryptoPrivateStateTransmit_1(CoreBuffer_1.CoreBuffer.from(obj.nonce), obj.counter, CoreBuffer_1.CoreBuffer.from(obj.secretKey), obj.algorithm, obj.id));
4193
+ return new CryptoPrivateStateTransmit_1(CoreBuffer_1.CoreBuffer.from(obj.nonce), obj.counter, CoreBuffer_1.CoreBuffer.from(obj.secretKey), obj.algorithm, obj.id);
4211
4194
  }
4212
4195
  static fromJSON(value) {
4213
4196
  CryptoValidation_1.CryptoValidation.checkEncryptionAlgorithm(value.alg);
@@ -4219,10 +4202,10 @@ let CryptoPrivateStateTransmit = CryptoPrivateStateTransmit_1 = class CryptoPriv
4219
4202
  }
4220
4203
  const nonceBuffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.nnc);
4221
4204
  const secretKeyBuffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.key);
4222
- return Promise.resolve(new CryptoPrivateStateTransmit_1(nonceBuffer, value.cnt, secretKeyBuffer, value.alg, value.id));
4205
+ return new CryptoPrivateStateTransmit_1(nonceBuffer, value.cnt, secretKeyBuffer, value.alg, value.id);
4223
4206
  }
4224
- static async deserialize(value) {
4225
- return await this.fromJSON(JSON.parse(value));
4207
+ static deserialize(value) {
4208
+ return this.fromJSON(JSON.parse(value));
4226
4209
  }
4227
4210
  };
4228
4211
  CryptoPrivateStateTransmit = CryptoPrivateStateTransmit_1 = __decorate([
@@ -4258,7 +4241,7 @@ const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-s
4258
4241
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
4259
4242
  const CryptoValidation_1 = __webpack_require__(/*! ../CryptoValidation */ "./dist/CryptoValidation.js");
4260
4243
  const CryptoStateType_1 = __webpack_require__(/*! ./CryptoStateType */ "./dist/state/CryptoStateType.js");
4261
- let CryptoPublicState = CryptoPublicState_1 = class CryptoPublicState extends ts_serval_1.SerializableAsync {
4244
+ let CryptoPublicState = CryptoPublicState_1 = class CryptoPublicState extends ts_serval_1.Serializable {
4262
4245
  constructor(nonce, algorithm, stateType, id) {
4263
4246
  CryptoValidation_1.CryptoValidation.checkEncryptionAlgorithm(algorithm);
4264
4247
  CryptoValidation_1.CryptoValidation.checkNonceForAlgorithm(nonce, algorithm);
@@ -4299,7 +4282,7 @@ let CryptoPublicState = CryptoPublicState_1 = class CryptoPublicState extends ts
4299
4282
  return obj;
4300
4283
  }
4301
4284
  static from(value) {
4302
- return Promise.resolve(new CryptoPublicState_1(value.nonce, value.algorithm, value.stateType, value.id));
4285
+ return new CryptoPublicState_1(value.nonce, value.algorithm, value.stateType, value.id);
4303
4286
  }
4304
4287
  static fromJSON(value) {
4305
4288
  let error;
@@ -4313,13 +4296,13 @@ let CryptoPublicState = CryptoPublicState_1 = class CryptoPublicState extends ts
4313
4296
  if (error)
4314
4297
  throw error;
4315
4298
  const buffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.nnc);
4316
- return Promise.resolve(new CryptoPublicState_1(buffer, value.alg, value.typ, value.id));
4299
+ return new CryptoPublicState_1(buffer, value.alg, value.typ, value.id);
4317
4300
  }
4318
- static async fromBase64(value) {
4319
- return await this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
4301
+ static fromBase64(value) {
4302
+ return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
4320
4303
  }
4321
- static async deserialize(value) {
4322
- return await this.fromJSON(JSON.parse(value));
4304
+ static deserialize(value) {
4305
+ return this.fromJSON(JSON.parse(value));
4323
4306
  }
4324
4307
  };
4325
4308
  CryptoPublicState = CryptoPublicState_1 = __decorate([
@@ -4459,7 +4442,7 @@ var CryptoStreamAddress_1;
4459
4442
  Object.defineProperty(exports, "__esModule", ({ value: true }));
4460
4443
  exports.CryptoStreamAddress = void 0;
4461
4444
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
4462
- let CryptoStreamAddress = CryptoStreamAddress_1 = class CryptoStreamAddress extends ts_serval_1.SerializableAsync {
4445
+ let CryptoStreamAddress = CryptoStreamAddress_1 = class CryptoStreamAddress extends ts_serval_1.Serializable {
4463
4446
  constructor(address) {
4464
4447
  super();
4465
4448
  this.address = address;
@@ -4480,16 +4463,16 @@ let CryptoStreamAddress = CryptoStreamAddress_1 = class CryptoStreamAddress exte
4480
4463
  }
4481
4464
  static from(obj) {
4482
4465
  if (typeof obj === "string") {
4483
- return Promise.resolve(new CryptoStreamAddress_1(obj));
4466
+ return new CryptoStreamAddress_1(obj);
4484
4467
  }
4485
4468
  if (!obj.address) {
4486
4469
  throw new Error("No address property set.");
4487
4470
  }
4488
- return Promise.resolve(new CryptoStreamAddress_1(obj.address));
4471
+ return new CryptoStreamAddress_1(obj.address);
4489
4472
  }
4490
- static async deserialize(value) {
4473
+ static deserialize(value) {
4491
4474
  const obj = JSON.parse(value);
4492
- return await this.from(obj);
4475
+ return this.from(obj);
4493
4476
  }
4494
4477
  };
4495
4478
  CryptoStreamAddress = CryptoStreamAddress_1 = __decorate([
@@ -4523,7 +4506,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
4523
4506
  exports.CryptoStreamHeader = void 0;
4524
4507
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
4525
4508
  const CoreBuffer_1 = __webpack_require__(/*! ../CoreBuffer */ "./dist/CoreBuffer.js");
4526
- let CryptoStreamHeader = CryptoStreamHeader_1 = class CryptoStreamHeader extends ts_serval_1.SerializableAsync {
4509
+ let CryptoStreamHeader = CryptoStreamHeader_1 = class CryptoStreamHeader extends ts_serval_1.Serializable {
4527
4510
  constructor(header) {
4528
4511
  super();
4529
4512
  this.header = header;
@@ -4550,15 +4533,15 @@ let CryptoStreamHeader = CryptoStreamHeader_1 = class CryptoStreamHeader extends
4550
4533
  throw new Error("No state or header property set.");
4551
4534
  }
4552
4535
  const header = CoreBuffer_1.CoreBuffer.fromBase64(obj.header);
4553
- return Promise.resolve(new CryptoStreamHeader_1(header));
4536
+ return new CryptoStreamHeader_1(header);
4554
4537
  }
4555
4538
  static deserialize(value) {
4556
4539
  const obj = JSON.parse(value);
4557
- return Promise.resolve(this.from(obj));
4540
+ return this.from(obj);
4558
4541
  }
4559
4542
  static fromBase64(value) {
4560
4543
  const buffer = CoreBuffer_1.CoreBuffer.fromBase64(value);
4561
- return Promise.resolve(new CryptoStreamHeader_1(buffer));
4544
+ return new CryptoStreamHeader_1(buffer);
4562
4545
  }
4563
4546
  };
4564
4547
  CryptoStreamHeader = CryptoStreamHeader_1 = __decorate([
@@ -4593,7 +4576,7 @@ exports.CryptoStreamState = void 0;
4593
4576
  const ts_serval_1 = __webpack_require__(/*! @js-soft/ts-serval */ "@js-soft/ts-serval");
4594
4577
  const CryptoStreamAddress_1 = __webpack_require__(/*! ./CryptoStreamAddress */ "./dist/stream/CryptoStreamAddress.js");
4595
4578
  const CryptoStreamHeader_1 = __webpack_require__(/*! ./CryptoStreamHeader */ "./dist/stream/CryptoStreamHeader.js");
4596
- let CryptoStreamState = CryptoStreamState_1 = class CryptoStreamState extends ts_serval_1.SerializableAsync {
4579
+ let CryptoStreamState = CryptoStreamState_1 = class CryptoStreamState extends ts_serval_1.Serializable {
4597
4580
  constructor(address, header) {
4598
4581
  super();
4599
4582
  this.address = address;
@@ -4614,17 +4597,17 @@ let CryptoStreamState = CryptoStreamState_1 = class CryptoStreamState extends ts
4614
4597
  };
4615
4598
  return obj;
4616
4599
  }
4617
- static async from(obj) {
4600
+ static from(obj) {
4618
4601
  if (!obj.address || !obj.header) {
4619
4602
  throw new Error("No address or header property set.");
4620
4603
  }
4621
- const address = await CryptoStreamAddress_1.CryptoStreamAddress.from({ address: obj.address });
4622
- const header = await CryptoStreamHeader_1.CryptoStreamHeader.fromBase64(obj.header);
4604
+ const address = CryptoStreamAddress_1.CryptoStreamAddress.from({ address: obj.address });
4605
+ const header = CryptoStreamHeader_1.CryptoStreamHeader.fromBase64(obj.header);
4623
4606
  return new CryptoStreamState_1(address, header);
4624
4607
  }
4625
- static async deserialize(value) {
4608
+ static deserialize(value) {
4626
4609
  const obj = JSON.parse(value);
4627
- return await this.from(obj);
4610
+ return this.from(obj);
4628
4611
  }
4629
4612
  };
4630
4613
  CryptoStreamState = CryptoStreamState_1 = __decorate([
@@ -4657,7 +4640,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
4657
4640
  \**************************************************************************************/
4658
4641
  /***/ (function(module, exports, __webpack_require__) {
4659
4642
 
4660
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!function(e){function r(e,r){"use strict";var t,a=r.ready.then((function(){function a(){if(0!==t._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var r=["crypto_aead_chacha20poly1305_decrypt","crypto_aead_chacha20poly1305_decrypt_detached","crypto_aead_chacha20poly1305_encrypt","crypto_aead_chacha20poly1305_encrypt_detached","crypto_aead_chacha20poly1305_ietf_decrypt","crypto_aead_chacha20poly1305_ietf_decrypt_detached","crypto_aead_chacha20poly1305_ietf_encrypt","crypto_aead_chacha20poly1305_ietf_encrypt_detached","crypto_aead_chacha20poly1305_ietf_keygen","crypto_aead_chacha20poly1305_keygen","crypto_aead_xchacha20poly1305_ietf_decrypt","crypto_aead_xchacha20poly1305_ietf_decrypt_detached","crypto_aead_xchacha20poly1305_ietf_encrypt","crypto_aead_xchacha20poly1305_ietf_encrypt_detached","crypto_aead_xchacha20poly1305_ietf_keygen","crypto_auth","crypto_auth_hmacsha256","crypto_auth_hmacsha256_keygen","crypto_auth_hmacsha256_verify","crypto_auth_hmacsha512","crypto_auth_hmacsha512_keygen","crypto_auth_hmacsha512_verify","crypto_auth_keygen","crypto_auth_verify","crypto_box_beforenm","crypto_box_curve25519xchacha20poly1305_keypair","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_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_ristretto255_add","crypto_core_ristretto255_from_hash","crypto_core_ristretto255_is_valid_point","crypto_core_ristretto255_random","crypto_core_ristretto255_scalar_add","crypto_core_ristretto255_scalar_complement","crypto_core_ristretto255_scalar_invert","crypto_core_ristretto255_scalar_mul","crypto_core_ristretto255_scalar_negate","crypto_core_ristretto255_scalar_random","crypto_core_ristretto255_scalar_reduce","crypto_core_ristretto255_scalar_sub","crypto_core_ristretto255_sub","crypto_generichash","crypto_generichash_blake2b_salt_personal","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha256_final","crypto_hash_sha256_init","crypto_hash_sha256_update","crypto_hash_sha512","crypto_hash_sha512_final","crypto_hash_sha512_init","crypto_hash_sha512_update","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_needs_rehash","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_scalarmult_ed25519","crypto_scalarmult_ed25519_base","crypto_scalarmult_ed25519_base_noclamp","crypto_scalarmult_ed25519_noclamp","crypto_scalarmult_ristretto255","crypto_scalarmult_ristretto255_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],a=[E,x,k,S,T,w,Y,B,A,K,M,I,N,L,U,O,C,R,P,G,X,D,F,V,H,q,j,z,W,J,Q,Z,$,ee,re,te,ae,_e,se,ne,ce,oe,he,pe,ye,ie,le,ue,de,ve,ge,be,fe,me,Ee,xe,ke,Se,Te,we,Ye,Be,Ae,Ke,Me,Ie,Ne,Le,Ue,Oe,Ce,Re,Pe,Ge,Xe,De,Fe,Ve,He,qe,je,ze,We,Je,Qe,Ze,$e,er,rr,tr,ar,_r,sr,nr,cr,or,hr,pr,yr,ir,lr,ur,dr,vr,gr,br,fr,mr,Er,xr,kr,Sr,Tr,wr,Yr,Br,Ar,Kr,Mr,Ir,Nr,Lr,Ur,Or,Cr,Rr,Pr,Gr,Xr,Dr,Fr,Vr,Hr,qr,jr,zr,Wr,Jr,Qr,Zr,$r,et,rt,tt,at,_t,st,nt,ct,ot,ht,pt,yt,it],_=0;_<a.length;_++)"function"==typeof t["_"+r[_]]&&(e[r[_]]=a[_]);var s=["SODIUM_LIBRARY_VERSION_MAJOR","SODIUM_LIBRARY_VERSION_MINOR","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_salsa20_CONSTBYTES","crypto_core_salsa20_INPUTBYTES","crypto_core_salsa20_KEYBYTES","crypto_core_salsa20_OUTPUTBYTES","crypto_generichash_BYTES","crypto_generichash_BYTES_MAX","crypto_generichash_BYTES_MIN","crypto_generichash_KEYBYTES","crypto_generichash_KEYBYTES_MAX","crypto_generichash_KEYBYTES_MIN","crypto_generichash_blake2b_BYTES","crypto_generichash_blake2b_BYTES_MAX","crypto_generichash_blake2b_BYTES_MIN","crypto_generichash_blake2b_KEYBYTES","crypto_generichash_blake2b_KEYBYTES_MAX","crypto_generichash_blake2b_KEYBYTES_MIN","crypto_generichash_blake2b_PERSONALBYTES","crypto_generichash_blake2b_SALTBYTES","crypto_hash_BYTES","crypto_hash_sha256_BYTES","crypto_hash_sha512_BYTES","crypto_kdf_BYTES_MAX","crypto_kdf_BYTES_MIN","crypto_kdf_CONTEXTBYTES","crypto_kdf_KEYBYTES","crypto_kdf_blake2b_BYTES_MAX","crypto_kdf_blake2b_BYTES_MIN","crypto_kdf_blake2b_CONTEXTBYTES","crypto_kdf_blake2b_KEYBYTES","crypto_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_SALTBYTES","crypto_pwhash_argon2i_STRBYTES","crypto_pwhash_argon2id_BYTES_MAX","crypto_pwhash_argon2id_BYTES_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_SALTBYTES","crypto_pwhash_scryptsalsa208sha256_STRBYTES","crypto_scalarmult_BYTES","crypto_scalarmult_SCALARBYTES","crypto_scalarmult_curve25519_BYTES","crypto_scalarmult_curve25519_SCALARBYTES","crypto_scalarmult_ed25519_BYTES","crypto_scalarmult_ed25519_SCALARBYTES","crypto_scalarmult_ristretto255_BYTES","crypto_scalarmult_ristretto255_SCALARBYTES","crypto_secretbox_KEYBYTES","crypto_secretbox_MACBYTES","crypto_secretbox_MESSAGEBYTES_MAX","crypto_secretbox_NONCEBYTES","crypto_secretbox_xchacha20poly1305_KEYBYTES","crypto_secretbox_xchacha20poly1305_MACBYTES","crypto_secretbox_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretbox_xchacha20poly1305_NONCEBYTES","crypto_secretbox_xsalsa20poly1305_KEYBYTES","crypto_secretbox_xsalsa20poly1305_MACBYTES","crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX","crypto_secretbox_xsalsa20poly1305_NONCEBYTES","crypto_secretstream_xchacha20poly1305_ABYTES","crypto_secretstream_xchacha20poly1305_HEADERBYTES","crypto_secretstream_xchacha20poly1305_KEYBYTES","crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretstream_xchacha20poly1305_TAG_FINAL","crypto_secretstream_xchacha20poly1305_TAG_MESSAGE","crypto_secretstream_xchacha20poly1305_TAG_PUSH","crypto_secretstream_xchacha20poly1305_TAG_REKEY","crypto_shorthash_BYTES","crypto_shorthash_KEYBYTES","crypto_shorthash_siphash24_BYTES","crypto_shorthash_siphash24_KEYBYTES","crypto_shorthash_siphashx24_BYTES","crypto_shorthash_siphashx24_KEYBYTES","crypto_sign_BYTES","crypto_sign_MESSAGEBYTES_MAX","crypto_sign_PUBLICKEYBYTES","crypto_sign_SECRETKEYBYTES","crypto_sign_SEEDBYTES","crypto_sign_ed25519_BYTES","crypto_sign_ed25519_MESSAGEBYTES_MAX","crypto_sign_ed25519_PUBLICKEYBYTES","crypto_sign_ed25519_SECRETKEYBYTES","crypto_sign_ed25519_SEEDBYTES","crypto_stream_KEYBYTES","crypto_stream_MESSAGEBYTES_MAX","crypto_stream_NONCEBYTES","crypto_stream_chacha20_IETF_KEYBYTES","crypto_stream_chacha20_IETF_MESSAGEBYTES_MAX","crypto_stream_chacha20_IETF_NONCEBYTES","crypto_stream_chacha20_KEYBYTES","crypto_stream_chacha20_MESSAGEBYTES_MAX","crypto_stream_chacha20_NONCEBYTES","crypto_stream_chacha20_ietf_KEYBYTES","crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX","crypto_stream_chacha20_ietf_NONCEBYTES","crypto_stream_salsa2012_KEYBYTES","crypto_stream_salsa2012_MESSAGEBYTES_MAX","crypto_stream_salsa2012_NONCEBYTES","crypto_stream_salsa208_KEYBYTES","crypto_stream_salsa208_MESSAGEBYTES_MAX","crypto_stream_salsa208_NONCEBYTES","crypto_stream_salsa20_KEYBYTES","crypto_stream_salsa20_MESSAGEBYTES_MAX","crypto_stream_salsa20_NONCEBYTES","crypto_stream_xchacha20_KEYBYTES","crypto_stream_xchacha20_MESSAGEBYTES_MAX","crypto_stream_xchacha20_NONCEBYTES","crypto_stream_xsalsa20_KEYBYTES","crypto_stream_xsalsa20_MESSAGEBYTES_MAX","crypto_stream_xsalsa20_NONCEBYTES","crypto_verify_16_BYTES","crypto_verify_32_BYTES","crypto_verify_64_BYTES"];for(_=0;_<s.length;_++)"function"==typeof(c=t["_"+s[_].toLowerCase()])&&(e[s[_]]=c());var n=["SODIUM_VERSION_STRING","crypto_pwhash_STRPREFIX","crypto_pwhash_scryptsalsa208sha256_STRPREFIX"];for(_=0;_<n.length;_++){var c;"function"==typeof(c=t["_"+n[_].toLowerCase()])&&(e[n[_]]=t.UTF8ToString(c()))}}t=r;try{a();var _=new Uint8Array([98,97,108,108,115]),s=e.randombytes_buf(e.crypto_secretbox_NONCEBYTES),n=e.randombytes_buf(e.crypto_secretbox_KEYBYTES),c=e.crypto_secretbox_easy(_,s,n),o=e.crypto_secretbox_open_easy(c,s,n);if(e.memcmp(_,o))return}catch(e){if(null==t.useBackupModule)throw new Error("Both wasm and asm failed to load"+e)}t.useBackupModule(),a()}));function _(e){if("function"==typeof TextEncoder)return(new TextEncoder).encode(e);e=unescape(encodeURIComponent(e));for(var r=new Uint8Array(e.length),t=0,a=e.length;t<a;t++)r[t]=e.charCodeAt(t);return r}function s(e){if("function"==typeof TextDecoder)return new TextDecoder("utf-8",{fatal:!0}).decode(e);var r=8192,t=Math.ceil(e.length/r);if(t<=1)try{return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}catch(e){throw new TypeError("The encoded data was not valid.")}for(var a="",_=0,n=0;n<t;n++){var c=Array.prototype.slice.call(e,n*r+_,(n+1)*r+_);if(0!=c.length){var o,h=c.length,p=0;do{var y=c[--h];y>=240?(p=4,o=!0):y>=224?(p=3,o=!0):y>=192?(p=2,o=!0):y<128&&(p=1,o=!0)}while(!o);for(var i=p-(c.length-h),l=0;l<i;l++)_--,c.pop();a+=s(c)}}return a}function n(e){e=m(null,e,"input");for(var r,t,a,_="",s=0;s<e.length;s++)a=87+(t=15&e[s])+(t-10>>8&-39)<<8|87+(r=e[s]>>>4)+(r-10>>8&-39),_+=String.fromCharCode(255&a)+String.fromCharCode(a>>>8);return _}var c={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function o(e){if(null==e)return c.URLSAFE_NO_PADDING;if(e!==c.ORIGINAL&&e!==c.ORIGINAL_NO_PADDING&&e!==c.URLSAFE&&e!=c.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function h(e,r){r=o(r),e=m(_,e,"input");var a,_=[],n=0|Math.floor(e.length/3),c=e.length-3*n,h=4*n+(0!==c?0==(2&r)?4:2+(c>>>1):0),p=new l(h+1),y=u(e);return _.push(y),_.push(p.address),0===t._sodium_bin2base64(p.address,p.length,y,e.length,r)&&g(_,"conversion failed"),p.length=h,a=s(p.to_Uint8Array()),v(_),a}function p(e,r){var t=r||"uint8array";if(!y(t))throw new Error(t+" output format is not available");if(e instanceof l){if("uint8array"===t)return e.to_Uint8Array();if("text"===t)return s(e.to_Uint8Array());if("hex"===t)return n(e.to_Uint8Array());if("base64"===t)return h(e.to_Uint8Array(),c.URLSAFE_NO_PADDING);throw new Error('What is output format "'+t+'"?')}if("object"==typeof e){for(var a=Object.keys(e),_={},o=0;o<a.length;o++)_[a[o]]=p(e[a[o]],t);return _}if("string"==typeof e)return e;throw new TypeError("Cannot format output")}function y(e){for(var r=["uint8array","text","hex","base64"],t=0;t<r.length;t++)if(r[t]===e)return!0;return!1}function i(e){if(e){if("string"!=typeof e)throw new TypeError("When defined, the output format must be a string");if(!y(e))throw new Error(e+" is not a supported output format")}}function l(e){this.length=e,this.address=d(e)}function u(e){var r=d(e.length);return t.HEAPU8.set(e,r),r}function d(e){var r=t._malloc(e);if(0===r)throw{message:"_malloc() failed",length:e};return r}function v(e){if(e)for(var r=0;r<e.length;r++)a=e[r],t._free(a);var a}function g(e,r){throw v(e),new Error(r)}function b(e,r){throw v(e),new TypeError(r)}function f(e,r,t){null==r&&b(e,t+" cannot be null or undefined")}function m(e,r,t){return f(e,r,t),r instanceof Uint8Array?r:"string"==typeof r?_(r):void b(e,"unsupported input type for "+t)}function E(e,r,a,_,s,n){var c=[];i(n);var o=null;null!=e&&(o=u(e=m(c,e,"secret_nonce")),e.length,c.push(o)),r=m(c,r,"ciphertext");var h,y=t._crypto_aead_chacha20poly1305_abytes(),d=r.length;d<y&&b(c,"ciphertext is too short"),h=u(r),c.push(h);var f=null,E=0;null!=a&&(f=u(a=m(c,a,"additional_data")),E=a.length,c.push(f)),_=m(c,_,"public_nonce");var x,k=0|t._crypto_aead_chacha20poly1305_npubbytes();_.length!==k&&b(c,"invalid public_nonce length"),x=u(_),c.push(x),s=m(c,s,"key");var S,T=0|t._crypto_aead_chacha20poly1305_keybytes();s.length!==T&&b(c,"invalid key length"),S=u(s),c.push(S);var w=new l(d-t._crypto_aead_chacha20poly1305_abytes()|0),Y=w.address;if(c.push(Y),0===t._crypto_aead_chacha20poly1305_decrypt(Y,null,o,h,d,0,f,E,0,x,S)){var B=p(w,n);return v(c),B}g(c,"ciphertext cannot be decrypted using that key")}function x(e,r,a,_,s,n,c){var o=[];i(c);var h=null;null!=e&&(h=u(e=m(o,e,"secret_nonce")),e.length,o.push(h));var y=u(r=m(o,r,"ciphertext")),d=r.length;o.push(y),a=m(o,a,"mac");var f,E=0|t._crypto_box_macbytes();a.length!==E&&b(o,"invalid mac length"),f=u(a),o.push(f);var x=null,k=0;null!=_&&(x=u(_=m(o,_,"additional_data")),k=_.length,o.push(x)),s=m(o,s,"public_nonce");var S,T=0|t._crypto_aead_chacha20poly1305_npubbytes();s.length!==T&&b(o,"invalid public_nonce length"),S=u(s),o.push(S),n=m(o,n,"key");var w,Y=0|t._crypto_aead_chacha20poly1305_keybytes();n.length!==Y&&b(o,"invalid key length"),w=u(n),o.push(w);var B=new l(0|d),A=B.address;if(o.push(A),0===t._crypto_aead_chacha20poly1305_decrypt_detached(A,h,y,d,0,f,x,k,0,S,w)){var K=p(B,c);return v(o),K}g(o,"ciphertext cannot be decrypted using that key")}function k(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_chacha20poly1305_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_chacha20poly1305_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(h+t._crypto_aead_chacha20poly1305_abytes()|0),w=T.address;if(c.push(w),0===t._crypto_aead_chacha20poly1305_encrypt(w,null,o,h,0,y,d,0,f,E,k)){var Y=p(T,n);return v(c),Y}g(c,"invalid usage")}function S(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_chacha20poly1305_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_chacha20poly1305_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(0|h),w=T.address;c.push(w);var Y=new l(0|t._crypto_aead_chacha20poly1305_abytes()),B=Y.address;if(c.push(B),0===t._crypto_aead_chacha20poly1305_encrypt_detached(w,B,null,o,h,0,y,d,0,f,E,k)){var A=p({ciphertext:T,mac:Y},n);return v(c),A}g(c,"invalid usage")}function T(e,r,a,_,s,n){var c=[];i(n);var o=null;null!=e&&(o=u(e=m(c,e,"secret_nonce")),e.length,c.push(o)),r=m(c,r,"ciphertext");var h,y=t._crypto_aead_chacha20poly1305_ietf_abytes(),d=r.length;d<y&&b(c,"ciphertext is too short"),h=u(r),c.push(h);var f=null,E=0;null!=a&&(f=u(a=m(c,a,"additional_data")),E=a.length,c.push(f)),_=m(c,_,"public_nonce");var x,k=0|t._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==k&&b(c,"invalid public_nonce length"),x=u(_),c.push(x),s=m(c,s,"key");var S,T=0|t._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==T&&b(c,"invalid key length"),S=u(s),c.push(S);var w=new l(d-t._crypto_aead_chacha20poly1305_ietf_abytes()|0),Y=w.address;if(c.push(Y),0===t._crypto_aead_chacha20poly1305_ietf_decrypt(Y,null,o,h,d,0,f,E,0,x,S)){var B=p(w,n);return v(c),B}g(c,"ciphertext cannot be decrypted using that key")}function w(e,r,a,_,s,n,c){var o=[];i(c);var h=null;null!=e&&(h=u(e=m(o,e,"secret_nonce")),e.length,o.push(h));var y=u(r=m(o,r,"ciphertext")),d=r.length;o.push(y),a=m(o,a,"mac");var f,E=0|t._crypto_box_macbytes();a.length!==E&&b(o,"invalid mac length"),f=u(a),o.push(f);var x=null,k=0;null!=_&&(x=u(_=m(o,_,"additional_data")),k=_.length,o.push(x)),s=m(o,s,"public_nonce");var S,T=0|t._crypto_aead_chacha20poly1305_ietf_npubbytes();s.length!==T&&b(o,"invalid public_nonce length"),S=u(s),o.push(S),n=m(o,n,"key");var w,Y=0|t._crypto_aead_chacha20poly1305_ietf_keybytes();n.length!==Y&&b(o,"invalid key length"),w=u(n),o.push(w);var B=new l(0|d),A=B.address;if(o.push(A),0===t._crypto_aead_chacha20poly1305_ietf_decrypt_detached(A,h,y,d,0,f,x,k,0,S,w)){var K=p(B,c);return v(o),K}g(o,"ciphertext cannot be decrypted using that key")}function Y(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(h+t._crypto_aead_chacha20poly1305_ietf_abytes()|0),w=T.address;if(c.push(w),0===t._crypto_aead_chacha20poly1305_ietf_encrypt(w,null,o,h,0,y,d,0,f,E,k)){var Y=p(T,n);return v(c),Y}g(c,"invalid usage")}function B(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(0|h),w=T.address;c.push(w);var Y=new l(0|t._crypto_aead_chacha20poly1305_ietf_abytes()),B=Y.address;if(c.push(B),0===t._crypto_aead_chacha20poly1305_ietf_encrypt_detached(w,B,null,o,h,0,y,d,0,f,E,k)){var A=p({ciphertext:T,mac:Y},n);return v(c),A}g(c,"invalid usage")}function A(e){var r=[];i(e);var a=new l(0|t._crypto_aead_chacha20poly1305_ietf_keybytes()),_=a.address;r.push(_),t._crypto_aead_chacha20poly1305_ietf_keygen(_);var s=p(a,e);return v(r),s}function K(e){var r=[];i(e);var a=new l(0|t._crypto_aead_chacha20poly1305_keybytes()),_=a.address;r.push(_),t._crypto_aead_chacha20poly1305_keygen(_);var s=p(a,e);return v(r),s}function M(e,r,a,_,s,n){var c=[];i(n);var o=null;null!=e&&(o=u(e=m(c,e,"secret_nonce")),e.length,c.push(o)),r=m(c,r,"ciphertext");var h,y=t._crypto_aead_xchacha20poly1305_ietf_abytes(),d=r.length;d<y&&b(c,"ciphertext is too short"),h=u(r),c.push(h);var f=null,E=0;null!=a&&(f=u(a=m(c,a,"additional_data")),E=a.length,c.push(f)),_=m(c,_,"public_nonce");var x,k=0|t._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==k&&b(c,"invalid public_nonce length"),x=u(_),c.push(x),s=m(c,s,"key");var S,T=0|t._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==T&&b(c,"invalid key length"),S=u(s),c.push(S);var w=new l(d-t._crypto_aead_xchacha20poly1305_ietf_abytes()|0),Y=w.address;if(c.push(Y),0===t._crypto_aead_xchacha20poly1305_ietf_decrypt(Y,null,o,h,d,0,f,E,0,x,S)){var B=p(w,n);return v(c),B}g(c,"ciphertext cannot be decrypted using that key")}function I(e,r,a,_,s,n,c){var o=[];i(c);var h=null;null!=e&&(h=u(e=m(o,e,"secret_nonce")),e.length,o.push(h));var y=u(r=m(o,r,"ciphertext")),d=r.length;o.push(y),a=m(o,a,"mac");var f,E=0|t._crypto_box_macbytes();a.length!==E&&b(o,"invalid mac length"),f=u(a),o.push(f);var x=null,k=0;null!=_&&(x=u(_=m(o,_,"additional_data")),k=_.length,o.push(x)),s=m(o,s,"public_nonce");var S,T=0|t._crypto_aead_xchacha20poly1305_ietf_npubbytes();s.length!==T&&b(o,"invalid public_nonce length"),S=u(s),o.push(S),n=m(o,n,"key");var w,Y=0|t._crypto_aead_xchacha20poly1305_ietf_keybytes();n.length!==Y&&b(o,"invalid key length"),w=u(n),o.push(w);var B=new l(0|d),A=B.address;if(o.push(A),0===t._crypto_aead_xchacha20poly1305_ietf_decrypt_detached(A,h,y,d,0,f,x,k,0,S,w)){var K=p(B,c);return v(o),K}g(o,"ciphertext cannot be decrypted using that key")}function N(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(h+t._crypto_aead_xchacha20poly1305_ietf_abytes()|0),w=T.address;if(c.push(w),0===t._crypto_aead_xchacha20poly1305_ietf_encrypt(w,null,o,h,0,y,d,0,f,E,k)){var Y=p(T,n);return v(c),Y}g(c,"invalid usage")}function L(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(0|h),w=T.address;c.push(w);var Y=new l(0|t._crypto_aead_xchacha20poly1305_ietf_abytes()),B=Y.address;if(c.push(B),0===t._crypto_aead_xchacha20poly1305_ietf_encrypt_detached(w,B,null,o,h,0,y,d,0,f,E,k)){var A=p({ciphertext:T,mac:Y},n);return v(c),A}g(c,"invalid usage")}function U(e){var r=[];i(e);var a=new l(0|t._crypto_aead_xchacha20poly1305_ietf_keybytes()),_=a.address;r.push(_),t._crypto_aead_xchacha20poly1305_ietf_keygen(_);var s=p(a,e);return v(r),s}function O(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_auth_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_auth_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_auth(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function C(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_auth_hmacsha256_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_auth_hmacsha256_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_auth_hmacsha256(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function R(e){var r=[];i(e);var a=new l(0|t._crypto_auth_hmacsha256_keybytes()),_=a.address;r.push(_),t._crypto_auth_hmacsha256_keygen(_);var s=p(a,e);return v(r),s}function P(e,r,a){var _=[];e=m(_,e,"tag");var s,n=0|t._crypto_auth_hmacsha256_bytes();e.length!==n&&b(_,"invalid tag length"),s=u(e),_.push(s);var c=u(r=m(_,r,"message")),o=r.length;_.push(c),a=m(_,a,"key");var h,p=0|t._crypto_auth_hmacsha256_keybytes();a.length!==p&&b(_,"invalid key length"),h=u(a),_.push(h);var y=0==(0|t._crypto_auth_hmacsha256_verify(s,c,o,0,h));return v(_),y}function G(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_auth_hmacsha512_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_auth_hmacsha512_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_auth_hmacsha512(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function X(e){var r=[];i(e);var a=new l(0|t._crypto_auth_hmacsha512_keybytes()),_=a.address;r.push(_),t._crypto_auth_hmacsha512_keygen(_);var s=p(a,e);return v(r),s}function D(e,r,a){var _=[];e=m(_,e,"tag");var s,n=0|t._crypto_auth_hmacsha512_bytes();e.length!==n&&b(_,"invalid tag length"),s=u(e),_.push(s);var c=u(r=m(_,r,"message")),o=r.length;_.push(c),a=m(_,a,"key");var h,p=0|t._crypto_auth_hmacsha512_keybytes();a.length!==p&&b(_,"invalid key length"),h=u(a),_.push(h);var y=0==(0|t._crypto_auth_hmacsha512_verify(s,c,o,0,h));return v(_),y}function F(e){var r=[];i(e);var a=new l(0|t._crypto_auth_keybytes()),_=a.address;r.push(_),t._crypto_auth_keygen(_);var s=p(a,e);return v(r),s}function V(e,r,a){var _=[];e=m(_,e,"tag");var s,n=0|t._crypto_auth_bytes();e.length!==n&&b(_,"invalid tag length"),s=u(e),_.push(s);var c=u(r=m(_,r,"message")),o=r.length;_.push(c),a=m(_,a,"key");var h,p=0|t._crypto_auth_keybytes();a.length!==p&&b(_,"invalid key length"),h=u(a),_.push(h);var y=0==(0|t._crypto_auth_verify(s,c,o,0,h));return v(_),y}function H(e,r,a){var _=[];i(a),e=m(_,e,"publicKey");var s,n=0|t._crypto_box_publickeybytes();e.length!==n&&b(_,"invalid publicKey length"),s=u(e),_.push(s),r=m(_,r,"privateKey");var c,o=0|t._crypto_box_secretkeybytes();r.length!==o&&b(_,"invalid privateKey length"),c=u(r),_.push(c);var h=new l(0|t._crypto_box_beforenmbytes()),y=h.address;if(_.push(y),0==(0|t._crypto_box_beforenm(y,s,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function q(e){var r=[];i(e);var a=new l(0|t._crypto_box_curve25519xchacha20poly1305_publickeybytes()),_=a.address;r.push(_);var s=new l(0|t._crypto_box_curve25519xchacha20poly1305_secretkeybytes()),n=s.address;r.push(n),t._crypto_box_curve25519xchacha20poly1305_keypair(_,n);var c=p({publicKey:a,privateKey:s,keyType:"curve25519"},e);return v(r),c}function j(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"publicKey");var c,o=0|t._crypto_box_curve25519xchacha20poly1305_publickeybytes();r.length!==o&&b(_,"invalid publicKey length"),c=u(r),_.push(c);var h=new l(n+t._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),y=h.address;_.push(y),t._crypto_box_curve25519xchacha20poly1305_seal(y,s,n,0,c);var d=p(h,a);return v(_),d}function z(e,r,a,_){var s=[];i(_),e=m(s,e,"ciphertext");var n,c=t._crypto_box_curve25519xchacha20poly1305_sealbytes(),o=e.length;o<c&&b(s,"ciphertext is too short"),n=u(e),s.push(n),r=m(s,r,"publicKey");var h,y=0|t._crypto_box_curve25519xchacha20poly1305_publickeybytes();r.length!==y&&b(s,"invalid publicKey length"),h=u(r),s.push(h),a=m(s,a,"secretKey");var d,g=0|t._crypto_box_curve25519xchacha20poly1305_secretkeybytes();a.length!==g&&b(s,"invalid secretKey length"),d=u(a),s.push(d);var f=new l(o-t._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),E=f.address;s.push(E),t._crypto_box_curve25519xchacha20poly1305_seal_open(E,n,o,0,h,d);var x=p(f,_);return v(s),x}function W(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"message")),o=e.length;n.push(c),r=m(n,r,"nonce");var h,y=0|t._crypto_box_noncebytes();r.length!==y&&b(n,"invalid nonce length"),h=u(r),n.push(h),a=m(n,a,"publicKey");var d,f=0|t._crypto_box_publickeybytes();a.length!==f&&b(n,"invalid publicKey length"),d=u(a),n.push(d),_=m(n,_,"privateKey");var E,x=0|t._crypto_box_secretkeybytes();_.length!==x&&b(n,"invalid privateKey length"),E=u(_),n.push(E);var k=new l(0|o),S=k.address;n.push(S);var T=new l(0|t._crypto_box_macbytes()),w=T.address;if(n.push(w),0==(0|t._crypto_box_detached(S,w,c,o,0,h,d,E))){var Y=p({ciphertext:k,mac:T},s);return v(n),Y}g(n,"invalid usage")}function J(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"message")),o=e.length;n.push(c),r=m(n,r,"nonce");var h,y=0|t._crypto_box_noncebytes();r.length!==y&&b(n,"invalid nonce length"),h=u(r),n.push(h),a=m(n,a,"publicKey");var d,f=0|t._crypto_box_publickeybytes();a.length!==f&&b(n,"invalid publicKey length"),d=u(a),n.push(d),_=m(n,_,"privateKey");var E,x=0|t._crypto_box_secretkeybytes();_.length!==x&&b(n,"invalid privateKey length"),E=u(_),n.push(E);var k=new l(o+t._crypto_box_macbytes()|0),S=k.address;if(n.push(S),0==(0|t._crypto_box_easy(S,c,o,0,h,d,E))){var T=p(k,s);return v(n),T}g(n,"invalid usage")}function Q(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_box_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"sharedKey");var y,d=0|t._crypto_box_beforenmbytes();a.length!==d&&b(s,"invalid sharedKey length"),y=u(a),s.push(y);var f=new l(c+t._crypto_box_macbytes()|0),E=f.address;if(s.push(E),0==(0|t._crypto_box_easy_afternm(E,n,c,0,o,y))){var x=p(f,_);return v(s),x}g(s,"invalid usage")}function Z(e){var r=[];i(e);var a=new l(0|t._crypto_box_publickeybytes()),_=a.address;r.push(_);var s=new l(0|t._crypto_box_secretkeybytes()),n=s.address;if(r.push(n),0==(0|t._crypto_box_keypair(_,n))){var c={publicKey:p(a,e),privateKey:p(s,e),keyType:"x25519"};return v(r),c}g(r,"internal error")}function $(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"ciphertext")),h=e.length;c.push(o),r=m(c,r,"mac");var y,d=0|t._crypto_box_macbytes();r.length!==d&&b(c,"invalid mac length"),y=u(r),c.push(y),a=m(c,a,"nonce");var f,E=0|t._crypto_box_noncebytes();a.length!==E&&b(c,"invalid nonce length"),f=u(a),c.push(f),_=m(c,_,"publicKey");var x,k=0|t._crypto_box_publickeybytes();_.length!==k&&b(c,"invalid publicKey length"),x=u(_),c.push(x),s=m(c,s,"privateKey");var S,T=0|t._crypto_box_secretkeybytes();s.length!==T&&b(c,"invalid privateKey length"),S=u(s),c.push(S);var w=new l(0|h),Y=w.address;if(c.push(Y),0==(0|t._crypto_box_open_detached(Y,o,y,h,0,f,x,S))){var B=p(w,n);return v(c),B}g(c,"incorrect key pair for the given ciphertext")}function ee(e,r,a,_,s){var n=[];i(s),e=m(n,e,"ciphertext");var c,o=t._crypto_box_macbytes(),h=e.length;h<o&&b(n,"ciphertext is too short"),c=u(e),n.push(c),r=m(n,r,"nonce");var y,d=0|t._crypto_box_noncebytes();r.length!==d&&b(n,"invalid nonce length"),y=u(r),n.push(y),a=m(n,a,"publicKey");var f,E=0|t._crypto_box_publickeybytes();a.length!==E&&b(n,"invalid publicKey length"),f=u(a),n.push(f),_=m(n,_,"privateKey");var x,k=0|t._crypto_box_secretkeybytes();_.length!==k&&b(n,"invalid privateKey length"),x=u(_),n.push(x);var S=new l(h-t._crypto_box_macbytes()|0),T=S.address;if(n.push(T),0==(0|t._crypto_box_open_easy(T,c,h,0,y,f,x))){var w=p(S,s);return v(n),w}g(n,"incorrect key pair for the given ciphertext")}function re(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"ciphertext")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_box_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"sharedKey");var y,d=0|t._crypto_box_beforenmbytes();a.length!==d&&b(s,"invalid sharedKey length"),y=u(a),s.push(y);var f=new l(c-t._crypto_box_macbytes()|0),E=f.address;if(s.push(E),0==(0|t._crypto_box_open_easy_afternm(E,n,c,0,o,y))){var x=p(f,_);return v(s),x}g(s,"incorrect secret key for the given ciphertext")}function te(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"publicKey");var c,o=0|t._crypto_box_publickeybytes();r.length!==o&&b(_,"invalid publicKey length"),c=u(r),_.push(c);var h=new l(n+t._crypto_box_sealbytes()|0),y=h.address;if(_.push(y),0==(0|t._crypto_box_seal(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function ae(e,r,a,_){var s=[];i(_),e=m(s,e,"ciphertext");var n,c=t._crypto_box_sealbytes(),o=e.length;o<c&&b(s,"ciphertext is too short"),n=u(e),s.push(n),r=m(s,r,"publicKey");var h,y=0|t._crypto_box_publickeybytes();r.length!==y&&b(s,"invalid publicKey length"),h=u(r),s.push(h),a=m(s,a,"privateKey");var d,f=0|t._crypto_box_secretkeybytes();a.length!==f&&b(s,"invalid privateKey length"),d=u(a),s.push(d);var E=new l(o-t._crypto_box_sealbytes()|0),x=E.address;if(s.push(x),0==(0|t._crypto_box_seal_open(x,n,o,0,h,d))){var k=p(E,_);return v(s),k}g(s,"incorrect key pair for the given ciphertext")}function _e(e,r){var a=[];i(r),e=m(a,e,"seed");var _,s=0|t._crypto_box_seedbytes();e.length!==s&&b(a,"invalid seed length"),_=u(e),a.push(_);var n=new l(0|t._crypto_box_publickeybytes()),c=n.address;a.push(c);var o=new l(0|t._crypto_box_secretkeybytes()),h=o.address;if(a.push(h),0==(0|t._crypto_box_seed_keypair(c,h,_))){var y={publicKey:p(n,r),privateKey:p(o,r),keyType:"x25519"};return v(a),y}g(a,"invalid usage")}function se(e,r,a){var _=[];i(a),e=m(_,e,"p");var s,n=0|t._crypto_core_ed25519_bytes();e.length!==n&&b(_,"invalid p length"),s=u(e),_.push(s),r=m(_,r,"q");var c,o=0|t._crypto_core_ed25519_bytes();r.length!==o&&b(_,"invalid q length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ed25519_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_core_ed25519_add(y,s,c))){var d=p(h,a);return v(_),d}g(_,"input is an invalid element")}function ne(e,r){var a=[];i(r);var _=u(e=m(a,e,"r"));e.length,a.push(_);var s=new l(0|t._crypto_core_ed25519_bytes()),n=s.address;if(a.push(n),0==(0|t._crypto_core_ed25519_from_hash(n,_))){var c=p(s,r);return v(a),c}g(a,"invalid usage")}function ce(e,r){var a=[];i(r);var _=u(e=m(a,e,"r"));e.length,a.push(_);var s=new l(0|t._crypto_core_ed25519_bytes()),n=s.address;if(a.push(n),0==(0|t._crypto_core_ed25519_from_uniform(n,_))){var c=p(s,r);return v(a),c}g(a,"invalid usage")}function oe(e,r){var a=[];i(r),e=m(a,e,"repr");var _,s=0|t._crypto_core_ed25519_bytes();e.length!==s&&b(a,"invalid repr length"),_=u(e),a.push(_);var n=1==(0|t._crypto_core_ed25519_is_valid_point(_));return v(a),n}function he(e){var r=[];i(e);var a=new l(0|t._crypto_core_ed25519_bytes()),_=a.address;r.push(_),t._crypto_core_ed25519_random(_);var s=p(a,e);return v(r),s}function pe(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ed25519_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ed25519_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ed25519_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ed25519_scalar_add(y,s,c);var d=p(h,a);return v(_),d}function ye(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ed25519_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ed25519_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ed25519_scalar_complement(c,_);var o=p(n,r);return v(a),o}function ie(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ed25519_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ed25519_scalarbytes()),c=n.address;if(a.push(c),0==(0|t._crypto_core_ed25519_scalar_invert(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid reciprocate")}function le(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ed25519_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ed25519_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ed25519_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ed25519_scalar_mul(y,s,c);var d=p(h,a);return v(_),d}function ue(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ed25519_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ed25519_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ed25519_scalar_negate(c,_);var o=p(n,r);return v(a),o}function de(e){var r=[];i(e);var a=new l(0|t._crypto_core_ed25519_scalarbytes()),_=a.address;r.push(_),t._crypto_core_ed25519_scalar_random(_);var s=p(a,e);return v(r),s}function ve(e,r){var a=[];i(r),e=m(a,e,"sample");var _,s=0|t._crypto_core_ed25519_nonreducedscalarbytes();e.length!==s&&b(a,"invalid sample length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ed25519_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ed25519_scalar_reduce(c,_);var o=p(n,r);return v(a),o}function ge(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ed25519_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ed25519_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ed25519_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ed25519_scalar_sub(y,s,c);var d=p(h,a);return v(_),d}function be(e,r,a){var _=[];i(a),e=m(_,e,"p");var s,n=0|t._crypto_core_ed25519_bytes();e.length!==n&&b(_,"invalid p length"),s=u(e),_.push(s),r=m(_,r,"q");var c,o=0|t._crypto_core_ed25519_bytes();r.length!==o&&b(_,"invalid q length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ed25519_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_core_ed25519_sub(y,s,c))){var d=p(h,a);return v(_),d}g(_,"input is an invalid element")}function fe(e,r,a){var _=[];i(a),e=m(_,e,"p");var s,n=0|t._crypto_core_ristretto255_bytes();e.length!==n&&b(_,"invalid p length"),s=u(e),_.push(s),r=m(_,r,"q");var c,o=0|t._crypto_core_ristretto255_bytes();r.length!==o&&b(_,"invalid q length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ristretto255_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_core_ristretto255_add(y,s,c))){var d=p(h,a);return v(_),d}g(_,"input is an invalid element")}function me(e,r){var a=[];i(r);var _=u(e=m(a,e,"r"));e.length,a.push(_);var s=new l(0|t._crypto_core_ristretto255_bytes()),n=s.address;if(a.push(n),0==(0|t._crypto_core_ristretto255_from_hash(n,_))){var c=p(s,r);return v(a),c}g(a,"invalid usage")}function Ee(e,r){var a=[];i(r),e=m(a,e,"repr");var _,s=0|t._crypto_core_ristretto255_bytes();e.length!==s&&b(a,"invalid repr length"),_=u(e),a.push(_);var n=1==(0|t._crypto_core_ristretto255_is_valid_point(_));return v(a),n}function xe(e){var r=[];i(e);var a=new l(0|t._crypto_core_ristretto255_bytes()),_=a.address;r.push(_),t._crypto_core_ristretto255_random(_);var s=p(a,e);return v(r),s}function ke(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ristretto255_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ristretto255_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ristretto255_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ristretto255_scalar_add(y,s,c);var d=p(h,a);return v(_),d}function Se(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ristretto255_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ristretto255_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ristretto255_scalar_complement(c,_);var o=p(n,r);return v(a),o}function Te(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ristretto255_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ristretto255_scalarbytes()),c=n.address;if(a.push(c),0==(0|t._crypto_core_ristretto255_scalar_invert(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid reciprocate")}function we(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ristretto255_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ristretto255_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ristretto255_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ristretto255_scalar_mul(y,s,c);var d=p(h,a);return v(_),d}function Ye(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ristretto255_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ristretto255_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ristretto255_scalar_negate(c,_);var o=p(n,r);return v(a),o}function Be(e){var r=[];i(e);var a=new l(0|t._crypto_core_ristretto255_scalarbytes()),_=a.address;r.push(_),t._crypto_core_ristretto255_scalar_random(_);var s=p(a,e);return v(r),s}function Ae(e,r){var a=[];i(r),e=m(a,e,"sample");var _,s=0|t._crypto_core_ristretto255_nonreducedscalarbytes();e.length!==s&&b(a,"invalid sample length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ristretto255_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ristretto255_scalar_reduce(c,_);var o=p(n,r);return v(a),o}function Ke(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ristretto255_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ristretto255_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ristretto255_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ristretto255_scalar_sub(y,s,c);var d=p(h,a);return v(_),d}function Me(e,r,a){var _=[];i(a),e=m(_,e,"p");var s,n=0|t._crypto_core_ristretto255_bytes();e.length!==n&&b(_,"invalid p length"),s=u(e),_.push(s),r=m(_,r,"q");var c,o=0|t._crypto_core_ristretto255_bytes();r.length!==o&&b(_,"invalid q length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ristretto255_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_core_ristretto255_sub(y,s,c))){var d=p(h,a);return v(_),d}g(_,"input is an invalid element")}function Ie(e,r,a,_){var s=[];i(_),f(s,e,"hash_length"),("number"!=typeof e||(0|e)!==e||e<0)&&b(s,"hash_length must be an unsigned integer");var n=u(r=m(s,r,"message")),c=r.length;s.push(n);var o=null,h=0;null!=a&&(o=u(a=m(s,a,"key")),h=a.length,s.push(o));var y=new l(e|=0),d=y.address;if(s.push(d),0==(0|t._crypto_generichash(d,e,n,c,0,o,h))){var E=p(y,_);return v(s),E}g(s,"invalid usage")}function Ne(e,r,a,_,s){var n=[];i(s),f(n,e,"subkey_len"),("number"!=typeof e||(0|e)!==e||e<0)&&b(n,"subkey_len must be an unsigned integer");var c=null,o=0;null!=r&&(c=u(r=m(n,r,"key")),o=r.length,n.push(c)),a=m(n,a,"id");var h,y=0|t._crypto_generichash_blake2b_saltbytes();a.length!==y&&b(n,"invalid id length"),h=u(a),n.push(h),_=m(n,_,"ctx");var d,E=0|t._crypto_generichash_blake2b_personalbytes();_.length!==E&&b(n,"invalid ctx length"),d=u(_),n.push(d);var x=new l(0|e),k=x.address;if(n.push(k),0==(0|t._crypto_generichash_blake2b_salt_personal(k,e,null,0,0,c,o,h,d))){var S=p(x,s);return v(n),S}g(n,"invalid usage")}function Le(e,r,a){var _=[];i(a),f(_,e,"state_address"),f(_,r,"hash_length"),("number"!=typeof r||(0|r)!==r||r<0)&&b(_,"hash_length must be an unsigned integer");var s=new l(r|=0),n=s.address;if(_.push(n),0==(0|t._crypto_generichash_final(e,n,r))){var c=(t._free(e),p(s,a));return v(_),c}g(_,"invalid usage")}function Ue(e,r,a){var _=[];i(a);var s=null,n=0;null!=e&&(s=u(e=m(_,e,"key")),n=e.length,_.push(s)),f(_,r,"hash_length"),("number"!=typeof r||(0|r)!==r||r<0)&&b(_,"hash_length must be an unsigned integer");var c=new l(357).address;if(0==(0|t._crypto_generichash_init(c,s,n,r))){var o=c;return v(_),o}g(_,"invalid usage")}function Oe(e){var r=[];i(e);var a=new l(0|t._crypto_generichash_keybytes()),_=a.address;r.push(_),t._crypto_generichash_keygen(_);var s=p(a,e);return v(r),s}function Ce(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_generichash_update(e,s,n))&&g(_,"invalid usage"),v(_)}function Re(e,r){var a=[];i(r);var _=u(e=m(a,e,"message")),s=e.length;a.push(_);var n=new l(0|t._crypto_hash_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_hash(c,_,s,0))){var o=p(n,r);return v(a),o}g(a,"invalid usage")}function Pe(e,r){var a=[];i(r);var _=u(e=m(a,e,"message")),s=e.length;a.push(_);var n=new l(0|t._crypto_hash_sha256_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_hash_sha256(c,_,s,0))){var o=p(n,r);return v(a),o}g(a,"invalid usage")}function Ge(e,r){var a=[];i(r),f(a,e,"state_address");var _=new l(0|t._crypto_hash_sha256_bytes()),s=_.address;if(a.push(s),0==(0|t._crypto_hash_sha256_final(e,s))){var n=(t._free(e),p(_,r));return v(a),n}g(a,"invalid usage")}function Xe(e){var r=[];i(e);var a=new l(104).address;if(0==(0|t._crypto_hash_sha256_init(a))){var _=a;return v(r),_}g(r,"invalid usage")}function De(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_hash_sha256_update(e,s,n))&&g(_,"invalid usage"),v(_)}function Fe(e,r){var a=[];i(r);var _=u(e=m(a,e,"message")),s=e.length;a.push(_);var n=new l(0|t._crypto_hash_sha512_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_hash_sha512(c,_,s,0))){var o=p(n,r);return v(a),o}g(a,"invalid usage")}function Ve(e,r){var a=[];i(r),f(a,e,"state_address");var _=new l(0|t._crypto_hash_sha512_bytes()),s=_.address;if(a.push(s),0==(0|t._crypto_hash_sha512_final(e,s))){var n=(t._free(e),p(_,r));return v(a),n}g(a,"invalid usage")}function He(e){var r=[];i(e);var a=new l(208).address;if(0==(0|t._crypto_hash_sha512_init(a))){var _=a;return v(r),_}g(r,"invalid usage")}function qe(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_hash_sha512_update(e,s,n))&&g(_,"invalid usage"),v(_)}function je(e,r,a,s,n){var c=[];i(n),f(c,e,"subkey_len"),("number"!=typeof e||(0|e)!==e||e<0)&&b(c,"subkey_len must be an unsigned integer"),f(c,r,"subkey_id"),("number"!=typeof r||(0|r)!==r||r<0)&&b(c,"subkey_id must be an unsigned integer"),"string"!=typeof a&&b(c,"ctx must be a string"),a=_(a+"\0"),null!=h&&a.length-1!==h&&b(c,"invalid ctx length");var o=u(a),h=a.length-1;c.push(o),s=m(c,s,"key");var y,d=0|t._crypto_kdf_keybytes();s.length!==d&&b(c,"invalid key length"),y=u(s),c.push(y);var g=new l(0|e),E=g.address;c.push(E),t._crypto_kdf_derive_from_key(E,e,r,r>>>24>>>8,o,y);var x=p(g,n);return v(c),x}function ze(e){var r=[];i(e);var a=new l(0|t._crypto_kdf_keybytes()),_=a.address;r.push(_),t._crypto_kdf_keygen(_);var s=p(a,e);return v(r),s}function We(e,r,a,_){var s=[];i(_),e=m(s,e,"clientPublicKey");var n,c=0|t._crypto_kx_publickeybytes();e.length!==c&&b(s,"invalid clientPublicKey length"),n=u(e),s.push(n),r=m(s,r,"clientSecretKey");var o,h=0|t._crypto_kx_secretkeybytes();r.length!==h&&b(s,"invalid clientSecretKey length"),o=u(r),s.push(o),a=m(s,a,"serverPublicKey");var y,d=0|t._crypto_kx_publickeybytes();a.length!==d&&b(s,"invalid serverPublicKey length"),y=u(a),s.push(y);var f=new l(0|t._crypto_kx_sessionkeybytes()),E=f.address;s.push(E);var x=new l(0|t._crypto_kx_sessionkeybytes()),k=x.address;if(s.push(k),0==(0|t._crypto_kx_client_session_keys(E,k,n,o,y))){var S=p({sharedRx:f,sharedTx:x},_);return v(s),S}g(s,"invalid usage")}function Je(e){var r=[];i(e);var a=new l(0|t._crypto_kx_publickeybytes()),_=a.address;r.push(_);var s=new l(0|t._crypto_kx_secretkeybytes()),n=s.address;if(r.push(n),0==(0|t._crypto_kx_keypair(_,n))){var c={publicKey:p(a,e),privateKey:p(s,e),keyType:"x25519"};return v(r),c}g(r,"internal error")}function Qe(e,r){var a=[];i(r),e=m(a,e,"seed");var _,s=0|t._crypto_kx_seedbytes();e.length!==s&&b(a,"invalid seed length"),_=u(e),a.push(_);var n=new l(0|t._crypto_kx_publickeybytes()),c=n.address;a.push(c);var o=new l(0|t._crypto_kx_secretkeybytes()),h=o.address;if(a.push(h),0==(0|t._crypto_kx_seed_keypair(c,h,_))){var y={publicKey:p(n,r),privateKey:p(o,r),keyType:"x25519"};return v(a),y}g(a,"internal error")}function Ze(e,r,a,_){var s=[];i(_),e=m(s,e,"serverPublicKey");var n,c=0|t._crypto_kx_publickeybytes();e.length!==c&&b(s,"invalid serverPublicKey length"),n=u(e),s.push(n),r=m(s,r,"serverSecretKey");var o,h=0|t._crypto_kx_secretkeybytes();r.length!==h&&b(s,"invalid serverSecretKey length"),o=u(r),s.push(o),a=m(s,a,"clientPublicKey");var y,d=0|t._crypto_kx_publickeybytes();a.length!==d&&b(s,"invalid clientPublicKey length"),y=u(a),s.push(y);var f=new l(0|t._crypto_kx_sessionkeybytes()),E=f.address;s.push(E);var x=new l(0|t._crypto_kx_sessionkeybytes()),k=x.address;if(s.push(k),0==(0|t._crypto_kx_server_session_keys(E,k,n,o,y))){var S=p({sharedRx:f,sharedTx:x},_);return v(s),S}g(s,"invalid usage")}function $e(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_onetimeauth_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_onetimeauth_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_onetimeauth(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function er(e,r){var a=[];i(r),f(a,e,"state_address");var _=new l(0|t._crypto_onetimeauth_bytes()),s=_.address;if(a.push(s),0==(0|t._crypto_onetimeauth_final(e,s))){var n=(t._free(e),p(_,r));return v(a),n}g(a,"invalid usage")}function rr(e,r){var a=[];i(r);var _=null;null!=e&&(_=u(e=m(a,e,"key")),e.length,a.push(_));var s=new l(144).address;if(0==(0|t._crypto_onetimeauth_init(s,_))){var n=s;return v(a),n}g(a,"invalid usage")}function tr(e){var r=[];i(e);var a=new l(0|t._crypto_onetimeauth_keybytes()),_=a.address;r.push(_),t._crypto_onetimeauth_keygen(_);var s=p(a,e);return v(r),s}function ar(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_onetimeauth_update(e,s,n))&&g(_,"invalid usage"),v(_)}function _r(e,r,a){var _=[];e=m(_,e,"hash");var s,n=0|t._crypto_onetimeauth_bytes();e.length!==n&&b(_,"invalid hash length"),s=u(e),_.push(s);var c=u(r=m(_,r,"message")),o=r.length;_.push(c),a=m(_,a,"key");var h,p=0|t._crypto_onetimeauth_keybytes();a.length!==p&&b(_,"invalid key length"),h=u(a),_.push(h);var y=0==(0|t._crypto_onetimeauth_verify(s,c,o,0,h));return v(_),y}function sr(e,r,a,_,s,n,c){var o=[];i(c),f(o,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&b(o,"keyLength must be an unsigned integer");var h=u(r=m(o,r,"password")),y=r.length;o.push(h),a=m(o,a,"salt");var d,E=0|t._crypto_pwhash_saltbytes();a.length!==E&&b(o,"invalid salt length"),d=u(a),o.push(d),f(o,_,"opsLimit"),("number"!=typeof _||(0|_)!==_||_<0)&&b(o,"opsLimit must be an unsigned integer"),f(o,s,"memLimit"),("number"!=typeof s||(0|s)!==s||s<0)&&b(o,"memLimit must be an unsigned integer"),f(o,n,"algorithm"),("number"!=typeof n||(0|n)!==n||n<0)&&b(o,"algorithm must be an unsigned integer");var x=new l(0|e),k=x.address;if(o.push(k),0==(0|t._crypto_pwhash(k,e,0,h,y,0,d,_,0,s,n))){var S=p(x,c);return v(o),S}g(o,"invalid usage")}function nr(e,r,a,_,s,n){var c=[];i(n),f(c,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&b(c,"keyLength must be an unsigned integer");var o=u(r=m(c,r,"password")),h=r.length;c.push(o),a=m(c,a,"salt");var y,d=0|t._crypto_pwhash_scryptsalsa208sha256_saltbytes();a.length!==d&&b(c,"invalid salt length"),y=u(a),c.push(y),f(c,_,"opsLimit"),("number"!=typeof _||(0|_)!==_||_<0)&&b(c,"opsLimit must be an unsigned integer"),f(c,s,"memLimit"),("number"!=typeof s||(0|s)!==s||s<0)&&b(c,"memLimit must be an unsigned integer");var E=new l(0|e),x=E.address;if(c.push(x),0==(0|t._crypto_pwhash_scryptsalsa208sha256(x,e,0,o,h,0,y,_,0,s))){var k=p(E,n);return v(c),k}g(c,"invalid usage")}function cr(e,r,a,_,s,n,c){var o=[];i(c);var h=u(e=m(o,e,"password")),y=e.length;o.push(h);var d=u(r=m(o,r,"salt")),E=r.length;o.push(d),f(o,a,"opsLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(o,"opsLimit must be an unsigned integer"),f(o,_,"r"),("number"!=typeof _||(0|_)!==_||_<0)&&b(o,"r must be an unsigned integer"),f(o,s,"p"),("number"!=typeof s||(0|s)!==s||s<0)&&b(o,"p must be an unsigned integer"),f(o,n,"keyLength"),("number"!=typeof n||(0|n)!==n||n<0)&&b(o,"keyLength must be an unsigned integer");var x=new l(0|n),k=x.address;if(o.push(k),0==(0|t._crypto_pwhash_scryptsalsa208sha256_ll(h,y,d,E,a,0,_,s,k,n))){var S=p(x,c);return v(o),S}g(o,"invalid usage")}function or(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"password")),c=e.length;s.push(n),f(s,r,"opsLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&b(s,"opsLimit must be an unsigned integer"),f(s,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(s,"memLimit must be an unsigned integer");var o=new l(0|t._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(s.push(o),0==(0|t._crypto_pwhash_scryptsalsa208sha256_str(o,n,c,0,r,0,a))){var h=t.UTF8ToString(o);return v(s),h}g(s,"invalid usage")}function hr(e,r,a){var s=[];i(a),"string"!=typeof e&&b(s,"hashed_password must be a string"),e=_(e+"\0"),null!=c&&e.length-1!==c&&b(s,"invalid hashed_password length");var n=u(e),c=e.length-1;s.push(n);var o=u(r=m(s,r,"password")),h=r.length;s.push(o);var p=0==(0|t._crypto_pwhash_scryptsalsa208sha256_str_verify(n,o,h,0));return v(s),p}function pr(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"password")),c=e.length;s.push(n),f(s,r,"opsLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&b(s,"opsLimit must be an unsigned integer"),f(s,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(s,"memLimit must be an unsigned integer");var o=new l(0|t._crypto_pwhash_strbytes()).address;if(s.push(o),0==(0|t._crypto_pwhash_str(o,n,c,0,r,0,a))){var h=t.UTF8ToString(o);return v(s),h}g(s,"invalid usage")}function yr(e,r,a,s){var n=[];i(s),"string"!=typeof e&&b(n,"hashed_password must be a string"),e=_(e+"\0"),null!=o&&e.length-1!==o&&b(n,"invalid hashed_password length");var c=u(e),o=e.length-1;n.push(c),f(n,r,"opsLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&b(n,"opsLimit must be an unsigned integer"),f(n,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(n,"memLimit must be an unsigned integer");var h=0!=(0|t._crypto_pwhash_str_needs_rehash(c,r,0,a));return v(n),h}function ir(e,r,a){var s=[];i(a),"string"!=typeof e&&b(s,"hashed_password must be a string"),e=_(e+"\0"),null!=c&&e.length-1!==c&&b(s,"invalid hashed_password length");var n=u(e),c=e.length-1;s.push(n);var o=u(r=m(s,r,"password")),h=r.length;s.push(o);var p=0==(0|t._crypto_pwhash_str_verify(n,o,h,0));return v(s),p}function lr(e,r,a){var _=[];i(a),e=m(_,e,"privateKey");var s,n=0|t._crypto_scalarmult_scalarbytes();e.length!==n&&b(_,"invalid privateKey length"),s=u(e),_.push(s),r=m(_,r,"publicKey");var c,o=0|t._crypto_scalarmult_bytes();r.length!==o&&b(_,"invalid publicKey length"),c=u(r),_.push(c);var h=new l(0|t._crypto_scalarmult_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_scalarmult(y,s,c))){var d=p(h,a);return v(_),d}g(_,"weak public key")}function ur(e,r){var a=[];i(r),e=m(a,e,"privateKey");var _,s=0|t._crypto_scalarmult_scalarbytes();e.length!==s&&b(a,"invalid privateKey length"),_=u(e),a.push(_);var n=new l(0|t._crypto_scalarmult_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_scalarmult_base(c,_))){var o=p(n,r);return v(a),o}g(a,"unknown error")}function dr(e,r,a){var _=[];i(a),e=m(_,e,"n");var s,n=0|t._crypto_scalarmult_ed25519_scalarbytes();e.length!==n&&b(_,"invalid n length"),s=u(e),_.push(s),r=m(_,r,"p");var c,o=0|t._crypto_scalarmult_ed25519_bytes();r.length!==o&&b(_,"invalid p length"),c=u(r),_.push(c);var h=new l(0|t._crypto_scalarmult_ed25519_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_scalarmult_ed25519(y,s,c))){var d=p(h,a);return v(_),d}g(_,"invalid point or scalar is 0")}function vr(e,r){var a=[];i(r),e=m(a,e,"scalar");var _,s=0|t._crypto_scalarmult_ed25519_scalarbytes();e.length!==s&&b(a,"invalid scalar length"),_=u(e),a.push(_);var n=new l(0|t._crypto_scalarmult_ed25519_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_scalarmult_ed25519_base(c,_))){var o=p(n,r);return v(a),o}g(a,"scalar is 0")}function gr(e,r){var a=[];i(r),e=m(a,e,"scalar");var _,s=0|t._crypto_scalarmult_ed25519_scalarbytes();e.length!==s&&b(a,"invalid scalar length"),_=u(e),a.push(_);var n=new l(0|t._crypto_scalarmult_ed25519_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_scalarmult_ed25519_base_noclamp(c,_))){var o=p(n,r);return v(a),o}g(a,"scalar is 0")}function br(e,r,a){var _=[];i(a),e=m(_,e,"n");var s,n=0|t._crypto_scalarmult_ed25519_scalarbytes();e.length!==n&&b(_,"invalid n length"),s=u(e),_.push(s),r=m(_,r,"p");var c,o=0|t._crypto_scalarmult_ed25519_bytes();r.length!==o&&b(_,"invalid p length"),c=u(r),_.push(c);var h=new l(0|t._crypto_scalarmult_ed25519_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_scalarmult_ed25519_noclamp(y,s,c))){var d=p(h,a);return v(_),d}g(_,"invalid point or scalar is 0")}function fr(e,r,a){var _=[];i(a),e=m(_,e,"scalar");var s,n=0|t._crypto_scalarmult_ristretto255_scalarbytes();e.length!==n&&b(_,"invalid scalar length"),s=u(e),_.push(s),r=m(_,r,"element");var c,o=0|t._crypto_scalarmult_ristretto255_bytes();r.length!==o&&b(_,"invalid element length"),c=u(r),_.push(c);var h=new l(0|t._crypto_scalarmult_ristretto255_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_scalarmult_ristretto255(y,s,c))){var d=p(h,a);return v(_),d}g(_,"result is identity element")}function mr(e,r){var a=[];i(r),e=m(a,e,"scalar");var _,s=0|t._crypto_core_ristretto255_scalarbytes();e.length!==s&&b(a,"invalid scalar length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ristretto255_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_scalarmult_ristretto255_base(c,_))){var o=p(n,r);return v(a),o}g(a,"scalar is 0")}function Er(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_secretbox_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"key");var y,d=0|t._crypto_secretbox_keybytes();a.length!==d&&b(s,"invalid key length"),y=u(a),s.push(y);var f=new l(0|c),E=f.address;s.push(E);var x=new l(0|t._crypto_secretbox_macbytes()),k=x.address;if(s.push(k),0==(0|t._crypto_secretbox_detached(E,k,n,c,0,o,y))){var S=p({mac:x,cipher:f},_);return v(s),S}g(s,"invalid usage")}function xr(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_secretbox_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"key");var y,d=0|t._crypto_secretbox_keybytes();a.length!==d&&b(s,"invalid key length"),y=u(a),s.push(y);var f=new l(c+t._crypto_secretbox_macbytes()|0),E=f.address;if(s.push(E),0==(0|t._crypto_secretbox_easy(E,n,c,0,o,y))){var x=p(f,_);return v(s),x}g(s,"invalid usage")}function kr(e){var r=[];i(e);var a=new l(0|t._crypto_secretbox_keybytes()),_=a.address;r.push(_),t._crypto_secretbox_keygen(_);var s=p(a,e);return v(r),s}function Sr(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"ciphertext")),o=e.length;n.push(c),r=m(n,r,"mac");var h,y=0|t._crypto_secretbox_macbytes();r.length!==y&&b(n,"invalid mac length"),h=u(r),n.push(h),a=m(n,a,"nonce");var d,f=0|t._crypto_secretbox_noncebytes();a.length!==f&&b(n,"invalid nonce length"),d=u(a),n.push(d),_=m(n,_,"key");var E,x=0|t._crypto_secretbox_keybytes();_.length!==x&&b(n,"invalid key length"),E=u(_),n.push(E);var k=new l(0|o),S=k.address;if(n.push(S),0==(0|t._crypto_secretbox_open_detached(S,c,h,o,0,d,E))){var T=p(k,s);return v(n),T}g(n,"wrong secret key for the given ciphertext")}function Tr(e,r,a,_){var s=[];i(_),e=m(s,e,"ciphertext");var n,c=t._crypto_secretbox_macbytes(),o=e.length;o<c&&b(s,"ciphertext is too short"),n=u(e),s.push(n),r=m(s,r,"nonce");var h,y=0|t._crypto_secretbox_noncebytes();r.length!==y&&b(s,"invalid nonce length"),h=u(r),s.push(h),a=m(s,a,"key");var d,f=0|t._crypto_secretbox_keybytes();a.length!==f&&b(s,"invalid key length"),d=u(a),s.push(d);var E=new l(o-t._crypto_secretbox_macbytes()|0),x=E.address;if(s.push(x),0==(0|t._crypto_secretbox_open_easy(x,n,o,0,h,d))){var k=p(E,_);return v(s),k}g(s,"wrong secret key for the given ciphertext")}function wr(e,r,a){var _=[];i(a),e=m(_,e,"header");var s,n=0|t._crypto_secretstream_xchacha20poly1305_headerbytes();e.length!==n&&b(_,"invalid header length"),s=u(e),_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_secretstream_xchacha20poly1305_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(52).address;if(0==(0|t._crypto_secretstream_xchacha20poly1305_init_pull(h,s,c))){var p=h;return v(_),p}g(_,"invalid usage")}function Yr(e,r){var a=[];i(r),e=m(a,e,"key");var _,s=0|t._crypto_secretstream_xchacha20poly1305_keybytes();e.length!==s&&b(a,"invalid key length"),_=u(e),a.push(_);var n=new l(52).address,c=new l(0|t._crypto_secretstream_xchacha20poly1305_headerbytes()),o=c.address;if(a.push(o),0==(0|t._crypto_secretstream_xchacha20poly1305_init_push(n,o,_))){var h={state:n,header:p(c,r)};return v(a),h}g(a,"invalid usage")}function Br(e){var r=[];i(e);var a=new l(0|t._crypto_secretstream_xchacha20poly1305_keybytes()),_=a.address;r.push(_),t._crypto_secretstream_xchacha20poly1305_keygen(_);var s=p(a,e);return v(r),s}function Ar(e,r,a,_){var s=[];i(_),f(s,e,"state_address"),r=m(s,r,"cipher");var n,c=t._crypto_secretstream_xchacha20poly1305_abytes(),o=r.length;o<c&&b(s,"cipher is too short"),n=u(r),s.push(n);var h=null,y=0;null!=a&&(h=u(a=m(s,a,"ad")),y=a.length,s.push(h));var g=new l(o-t._crypto_secretstream_xchacha20poly1305_abytes()|0),E=g.address;s.push(E);var x,k=(x=d(1),s.push(x),(k=0===t._crypto_secretstream_xchacha20poly1305_pull(e,E,0,x,n,o,0,h,y)&&{tag:t.HEAPU8[x],message:g})&&{message:p(k.message,_),tag:k.tag});return v(s),k}function Kr(e,r,a,_,s){var n=[];i(s),f(n,e,"state_address");var c=u(r=m(n,r,"message_chunk")),o=r.length;n.push(c);var h=null,y=0;null!=a&&(h=u(a=m(n,a,"ad")),y=a.length,n.push(h)),f(n,_,"tag"),("number"!=typeof _||(0|_)!==_||_<0)&&b(n,"tag must be an unsigned integer");var d=new l(o+t._crypto_secretstream_xchacha20poly1305_abytes()|0),E=d.address;if(n.push(E),0==(0|t._crypto_secretstream_xchacha20poly1305_push(e,E,0,c,o,0,h,y,0,_))){var x=p(d,s);return v(n),x}g(n,"invalid usage")}function Mr(e,r){var a=[];return i(r),f(a,e,"state_address"),t._crypto_secretstream_xchacha20poly1305_rekey(e),v(a),!0}function Ir(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_shorthash_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_shorthash_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_shorthash(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function Nr(e){var r=[];i(e);var a=new l(0|t._crypto_shorthash_keybytes()),_=a.address;r.push(_),t._crypto_shorthash_keygen(_);var s=p(a,e);return v(r),s}function Lr(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_shorthash_siphashx24_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_shorthash_siphashx24_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_shorthash_siphashx24(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function Ur(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"privateKey");var c,o=0|t._crypto_sign_secretkeybytes();r.length!==o&&b(_,"invalid privateKey length"),c=u(r),_.push(c);var h=new l(e.length+t._crypto_sign_bytes()|0),y=h.address;if(_.push(y),0==(0|t._crypto_sign(y,null,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function Or(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"privateKey");var c,o=0|t._crypto_sign_secretkeybytes();r.length!==o&&b(_,"invalid privateKey length"),c=u(r),_.push(c);var h=new l(0|t._crypto_sign_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_sign_detached(y,null,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function Cr(e,r){var a=[];i(r),e=m(a,e,"edPk");var _,s=0|t._crypto_sign_publickeybytes();e.length!==s&&b(a,"invalid edPk length"),_=u(e),a.push(_);var n=new l(0|t._crypto_scalarmult_scalarbytes()),c=n.address;if(a.push(c),0==(0|t._crypto_sign_ed25519_pk_to_curve25519(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid key")}function Rr(e,r){var a=[];i(r),e=m(a,e,"edSk");var _,s=0|t._crypto_sign_secretkeybytes();e.length!==s&&b(a,"invalid edSk length"),_=u(e),a.push(_);var n=new l(0|t._crypto_scalarmult_scalarbytes()),c=n.address;if(a.push(c),0==(0|t._crypto_sign_ed25519_sk_to_curve25519(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid key")}function Pr(e,r){var a=[];i(r),e=m(a,e,"privateKey");var _,s=0|t._crypto_sign_secretkeybytes();e.length!==s&&b(a,"invalid privateKey length"),_=u(e),a.push(_);var n=new l(0|t._crypto_sign_publickeybytes()),c=n.address;if(a.push(c),0==(0|t._crypto_sign_ed25519_sk_to_pk(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid key")}function Gr(e,r){var a=[];i(r),e=m(a,e,"privateKey");var _,s=0|t._crypto_sign_secretkeybytes();e.length!==s&&b(a,"invalid privateKey length"),_=u(e),a.push(_);var n=new l(0|t._crypto_sign_seedbytes()),c=n.address;if(a.push(c),0==(0|t._crypto_sign_ed25519_sk_to_seed(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid key")}function Xr(e,r,a){var _=[];i(a),f(_,e,"state_address"),r=m(_,r,"privateKey");var s,n=0|t._crypto_sign_secretkeybytes();r.length!==n&&b(_,"invalid privateKey length"),s=u(r),_.push(s);var c=new l(0|t._crypto_sign_bytes()),o=c.address;if(_.push(o),0==(0|t._crypto_sign_final_create(e,o,null,s))){var h=(t._free(e),p(c,a));return v(_),h}g(_,"invalid usage")}function Dr(e,r,a,_){var s=[];i(_),f(s,e,"state_address"),r=m(s,r,"signature");var n,c=0|t._crypto_sign_bytes();r.length!==c&&b(s,"invalid signature length"),n=u(r),s.push(n),a=m(s,a,"publicKey");var o,h=0|t._crypto_sign_publickeybytes();a.length!==h&&b(s,"invalid publicKey length"),o=u(a),s.push(o);var p=0==(0|t._crypto_sign_final_verify(e,n,o));return v(s),p}function Fr(e){var r=[];i(e);var a=new l(208).address;if(0==(0|t._crypto_sign_init(a))){var _=a;return v(r),_}g(r,"internal error")}function Vr(e){var r=[];i(e);var a=new l(0|t._crypto_sign_publickeybytes()),_=a.address;r.push(_);var s=new l(0|t._crypto_sign_secretkeybytes()),n=s.address;if(r.push(n),0==(0|t._crypto_sign_keypair(_,n))){var c={publicKey:p(a,e),privateKey:p(s,e),keyType:"ed25519"};return v(r),c}g(r,"internal error")}function Hr(e,r,a){var _=[];i(a),e=m(_,e,"signedMessage");var s,n=t._crypto_sign_bytes(),c=e.length;c<n&&b(_,"signedMessage is too short"),s=u(e),_.push(s),r=m(_,r,"publicKey");var o,h=0|t._crypto_sign_publickeybytes();r.length!==h&&b(_,"invalid publicKey length"),o=u(r),_.push(o);var y=new l(c-t._crypto_sign_bytes()|0),d=y.address;if(_.push(d),0==(0|t._crypto_sign_open(d,null,s,c,0,o))){var f=p(y,a);return v(_),f}g(_,"incorrect signature for the given public key")}function qr(e,r){var a=[];i(r),e=m(a,e,"seed");var _,s=0|t._crypto_sign_seedbytes();e.length!==s&&b(a,"invalid seed length"),_=u(e),a.push(_);var n=new l(0|t._crypto_sign_publickeybytes()),c=n.address;a.push(c);var o=new l(0|t._crypto_sign_secretkeybytes()),h=o.address;if(a.push(h),0==(0|t._crypto_sign_seed_keypair(c,h,_))){var y={publicKey:p(n,r),privateKey:p(o,r),keyType:"ed25519"};return v(a),y}g(a,"invalid usage")}function jr(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_sign_update(e,s,n))&&g(_,"invalid usage"),v(_)}function zr(e,r,a){var _=[];e=m(_,e,"signature");var s,n=0|t._crypto_sign_bytes();e.length!==n&&b(_,"invalid signature length"),s=u(e),_.push(s);var c=u(r=m(_,r,"message")),o=r.length;_.push(c),a=m(_,a,"publicKey");var h,p=0|t._crypto_sign_publickeybytes();a.length!==p&&b(_,"invalid publicKey length"),h=u(a),_.push(h);var y=0==(0|t._crypto_sign_verify_detached(s,c,o,0,h));return v(_),y}function Wr(e,r,a,_){var s=[];i(_),f(s,e,"outLength"),("number"!=typeof e||(0|e)!==e||e<0)&&b(s,"outLength must be an unsigned integer"),r=m(s,r,"key");var n,c=0|t._crypto_stream_chacha20_keybytes();r.length!==c&&b(s,"invalid key length"),n=u(r),s.push(n),a=m(s,a,"nonce");var o,h=0|t._crypto_stream_chacha20_noncebytes();a.length!==h&&b(s,"invalid nonce length"),o=u(a),s.push(o);var y=new l(0|e),d=y.address;s.push(d),t._crypto_stream_chacha20(d,e,0,o,n);var g=p(y,_);return v(s),g}function Jr(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"input_message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_stream_chacha20_ietf_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"key");var y,d=0|t._crypto_stream_chacha20_ietf_keybytes();a.length!==d&&b(s,"invalid key length"),y=u(a),s.push(y);var f=new l(0|c),E=f.address;if(s.push(E),0===t._crypto_stream_chacha20_ietf_xor(E,n,c,0,o,y)){var x=p(f,_);return v(s),x}g(s,"invalid usage")}function Qr(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"input_message")),o=e.length;n.push(c),r=m(n,r,"nonce");var h,y=0|t._crypto_stream_chacha20_ietf_noncebytes();r.length!==y&&b(n,"invalid nonce length"),h=u(r),n.push(h),f(n,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&b(n,"nonce_increment must be an unsigned integer"),_=m(n,_,"key");var d,E=0|t._crypto_stream_chacha20_ietf_keybytes();_.length!==E&&b(n,"invalid key length"),d=u(_),n.push(d);var x=new l(0|o),k=x.address;if(n.push(k),0===t._crypto_stream_chacha20_ietf_xor_ic(k,c,o,0,h,a,d)){var S=p(x,s);return v(n),S}g(n,"invalid usage")}function Zr(e){var r=[];i(e);var a=new l(0|t._crypto_stream_chacha20_keybytes()),_=a.address;r.push(_),t._crypto_stream_chacha20_keygen(_);var s=p(a,e);return v(r),s}function $r(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"input_message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_stream_chacha20_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"key");var y,d=0|t._crypto_stream_chacha20_keybytes();a.length!==d&&b(s,"invalid key length"),y=u(a),s.push(y);var f=new l(0|c),E=f.address;if(s.push(E),0===t._crypto_stream_chacha20_xor(E,n,c,0,o,y)){var x=p(f,_);return v(s),x}g(s,"invalid usage")}function et(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"input_message")),o=e.length;n.push(c),r=m(n,r,"nonce");var h,y=0|t._crypto_stream_chacha20_noncebytes();r.length!==y&&b(n,"invalid nonce length"),h=u(r),n.push(h),f(n,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&b(n,"nonce_increment must be an unsigned integer"),_=m(n,_,"key");var d,E=0|t._crypto_stream_chacha20_keybytes();_.length!==E&&b(n,"invalid key length"),d=u(_),n.push(d);var x=new l(0|o),k=x.address;if(n.push(k),0===t._crypto_stream_chacha20_xor_ic(k,c,o,0,h,a,0,d)){var S=p(x,s);return v(n),S}g(n,"invalid usage")}function rt(e){var r=[];i(e);var a=new l(0|t._crypto_stream_keybytes()),_=a.address;r.push(_),t._crypto_stream_keygen(_);var s=p(a,e);return v(r),s}function tt(e){var r=[];i(e);var a=new l(0|t._crypto_stream_xchacha20_keybytes()),_=a.address;r.push(_),t._crypto_stream_xchacha20_keygen(_);var s=p(a,e);return v(r),s}function at(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"input_message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_stream_xchacha20_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"key");var y,d=0|t._crypto_stream_xchacha20_keybytes();a.length!==d&&b(s,"invalid key length"),y=u(a),s.push(y);var f=new l(0|c),E=f.address;if(s.push(E),0===t._crypto_stream_xchacha20_xor(E,n,c,0,o,y)){var x=p(f,_);return v(s),x}g(s,"invalid usage")}function _t(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"input_message")),o=e.length;n.push(c),r=m(n,r,"nonce");var h,y=0|t._crypto_stream_xchacha20_noncebytes();r.length!==y&&b(n,"invalid nonce length"),h=u(r),n.push(h),f(n,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&b(n,"nonce_increment must be an unsigned integer"),_=m(n,_,"key");var d,E=0|t._crypto_stream_xchacha20_keybytes();_.length!==E&&b(n,"invalid key length"),d=u(_),n.push(d);var x=new l(0|o),k=x.address;if(n.push(k),0===t._crypto_stream_xchacha20_xor_ic(k,c,o,0,h,a,0,d)){var S=p(x,s);return v(n),S}g(n,"invalid usage")}function st(e,r){var a=[];i(r),f(a,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&b(a,"length must be an unsigned integer");var _=new l(0|e),s=_.address;a.push(s),t._randombytes_buf(s,e);var n=p(_,r);return v(a),n}function nt(e,r,a){var _=[];i(a),f(_,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&b(_,"length must be an unsigned integer"),r=m(_,r,"seed");var s,n=0|t._randombytes_seedbytes();r.length!==n&&b(_,"invalid seed length"),s=u(r),_.push(s);var c=new l(0|e),o=c.address;_.push(o),t._randombytes_buf_deterministic(o,e,s);var h=p(c,a);return v(_),h}function ct(e){i(e),t._randombytes_close()}function ot(e){i(e);var r=t._randombytes_random()>>>0;return v([]),r}function ht(e,r){var a=[];i(r);for(var _=t._malloc(24),s=0;s<6;s++)t.setValue(_+4*s,t.Runtime.addFunction(e[["implementation_name","random","stir","uniform","buf","close"][s]]),"i32");0!=(0|t._randombytes_set_implementation(_))&&g(a,"unsupported implementation"),v(a)}function pt(e){i(e),t._randombytes_stir()}function yt(e,r){var a=[];i(r),f(a,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&b(a,"upper_bound must be an unsigned integer");var _=t._randombytes_uniform(e)>>>0;return v(a),_}function it(){var e=t._sodium_version_string(),r=t.UTF8ToString(e);return v([]),r}return l.prototype.to_Uint8Array=function(){var e=new Uint8Array(this.length);return e.set(t.HEAPU8.subarray(this.address,this.address+this.length)),e},e.add=function(e,r){if(!(e instanceof Uint8Array&&r instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can added");var t=e.length,a=0,_=0;if(r.length!=e.length)throw new TypeError("Arguments must have the same length");for(_=0;_<t;_++)a>>=8,a+=e[_]+r[_],e[_]=255&a},e.base64_variants=c,e.compare=function(e,r){if(!(e instanceof Uint8Array&&r instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==r.length)throw new TypeError("Only instances of identical length can be compared");for(var t=0,a=1,_=e.length;_-- >0;)t|=r[_]-e[_]>>8&a,a&=(r[_]^e[_])-1>>8;return t+t+a-1},e.from_base64=function(e,r){r=o(r);var a,_=[],s=new l(3*(e=m(_,e,"input")).length/4),n=u(e),c=d(4),h=d(4);return _.push(n),_.push(s.address),_.push(s.result_bin_len_p),_.push(s.b64_end_p),0!==t._sodium_base642bin(s.address,s.length,n,e.length,0,c,h,r)&&g(_,"invalid input"),t.getValue(h,"i32")-n!==e.length&&g(_,"incomplete input"),s.length=t.getValue(c,"i32"),a=s.to_Uint8Array(),v(_),a},e.from_hex=function(e){var r,a=[],_=new l((e=m(a,e,"input")).length/2),s=u(e),n=d(4);return a.push(s),a.push(_.address),a.push(_.hex_end_p),0!==t._sodium_hex2bin(_.address,_.length,s,e.length,0,0,n)&&g(a,"invalid input"),t.getValue(n,"i32")-s!==e.length&&g(a,"incomplete input"),r=_.to_Uint8Array(),v(a),r},e.from_string=_,e.increment=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be incremented");for(var r=256,t=0,a=e.length;t<a;t++)r>>=8,r+=e[t],e[t]=255&r},e.is_zero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var r=0,t=0,a=e.length;t<a;t++)r|=e[t];return 0===r},e.libsodium=r,e.memcmp=function(e,r){if(!(e instanceof Uint8Array&&r instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==r.length)throw new TypeError("Only instances of identical length can be compared");for(var t=0,a=0,_=e.length;a<_;a++)t|=e[a]^r[a];return 0===t},e.memzero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be wiped");for(var r=0,t=e.length;r<t;r++)e[r]=0},e.output_formats=function(){return["uint8array","text","hex","base64"]},e.pad=function(e,r){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((r|=0)<=0)throw new Error("block size must be > 0");var a,_=[],s=d(4),n=1,c=0,o=0|e.length,h=new l(o+r);_.push(s),_.push(h.address);for(var p=h.address,y=h.address+o+r;p<y;p++)t.HEAPU8[p]=e[c],c+=n=1&~((65535&((o-=n)>>>48|o>>>32|o>>>16|o))-1>>16);return 0!==t._sodium_pad(s,h.address,e.length,r,h.length)&&g(_,"internal error"),h.length=t.getValue(s,"i32"),a=h.to_Uint8Array(),v(_),a},e.unpad=function(e,r){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((r|=0)<=0)throw new Error("block size must be > 0");var a=[],_=u(e),s=d(4);return a.push(_),a.push(s),0!==t._sodium_unpad(s,_,e.length,r)&&g(a,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,t.getValue(s,"i32")),v(a),e},e.ready=a,e.symbols=function(){return Object.keys(e).sort()},e.to_base64=h,e.to_hex=n,e.to_string=s,e}var t="object"==typeof e.sodium&&"function"==typeof e.sodium.onload?e.sodium.onload:null; true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports,__webpack_require__(/*! libsodium-sumo */ "./node_modules/libsodium-sumo/dist/modules-sumo/libsodium-sumo.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (r),
4643
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!function(e){function r(e,r){"use strict";var t,a=r.ready.then((function(){function a(){if(0!==t._sodium_init())throw new Error("libsodium was not correctly initialized.");for(var r=["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_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_keypair","crypto_box_curve25519xchacha20poly1305_seal","crypto_box_curve25519xchacha20poly1305_seal_open","crypto_box_detached","crypto_box_easy","crypto_box_easy_afternm","crypto_box_keypair","crypto_box_open_detached","crypto_box_open_easy","crypto_box_open_easy_afternm","crypto_box_seal","crypto_box_seal_open","crypto_box_seed_keypair","crypto_core_ed25519_add","crypto_core_ed25519_from_hash","crypto_core_ed25519_from_uniform","crypto_core_ed25519_is_valid_point","crypto_core_ed25519_random","crypto_core_ed25519_scalar_add","crypto_core_ed25519_scalar_complement","crypto_core_ed25519_scalar_invert","crypto_core_ed25519_scalar_mul","crypto_core_ed25519_scalar_negate","crypto_core_ed25519_scalar_random","crypto_core_ed25519_scalar_reduce","crypto_core_ed25519_scalar_sub","crypto_core_ed25519_sub","crypto_core_hchacha20","crypto_core_hsalsa20","crypto_core_ristretto255_add","crypto_core_ristretto255_from_hash","crypto_core_ristretto255_is_valid_point","crypto_core_ristretto255_random","crypto_core_ristretto255_scalar_add","crypto_core_ristretto255_scalar_complement","crypto_core_ristretto255_scalar_invert","crypto_core_ristretto255_scalar_mul","crypto_core_ristretto255_scalar_negate","crypto_core_ristretto255_scalar_random","crypto_core_ristretto255_scalar_reduce","crypto_core_ristretto255_scalar_sub","crypto_core_ristretto255_sub","crypto_generichash","crypto_generichash_blake2b_salt_personal","crypto_generichash_final","crypto_generichash_init","crypto_generichash_keygen","crypto_generichash_update","crypto_hash","crypto_hash_sha256","crypto_hash_sha256_final","crypto_hash_sha256_init","crypto_hash_sha256_update","crypto_hash_sha512","crypto_hash_sha512_final","crypto_hash_sha512_init","crypto_hash_sha512_update","crypto_kdf_derive_from_key","crypto_kdf_keygen","crypto_kx_client_session_keys","crypto_kx_keypair","crypto_kx_seed_keypair","crypto_kx_server_session_keys","crypto_onetimeauth","crypto_onetimeauth_final","crypto_onetimeauth_init","crypto_onetimeauth_keygen","crypto_onetimeauth_update","crypto_onetimeauth_verify","crypto_pwhash","crypto_pwhash_scryptsalsa208sha256","crypto_pwhash_scryptsalsa208sha256_ll","crypto_pwhash_scryptsalsa208sha256_str","crypto_pwhash_scryptsalsa208sha256_str_verify","crypto_pwhash_str","crypto_pwhash_str_needs_rehash","crypto_pwhash_str_verify","crypto_scalarmult","crypto_scalarmult_base","crypto_scalarmult_ed25519","crypto_scalarmult_ed25519_base","crypto_scalarmult_ed25519_base_noclamp","crypto_scalarmult_ed25519_noclamp","crypto_scalarmult_ristretto255","crypto_scalarmult_ristretto255_base","crypto_secretbox_detached","crypto_secretbox_easy","crypto_secretbox_keygen","crypto_secretbox_open_detached","crypto_secretbox_open_easy","crypto_secretstream_xchacha20poly1305_init_pull","crypto_secretstream_xchacha20poly1305_init_push","crypto_secretstream_xchacha20poly1305_keygen","crypto_secretstream_xchacha20poly1305_pull","crypto_secretstream_xchacha20poly1305_push","crypto_secretstream_xchacha20poly1305_rekey","crypto_shorthash","crypto_shorthash_keygen","crypto_shorthash_siphashx24","crypto_sign","crypto_sign_detached","crypto_sign_ed25519_pk_to_curve25519","crypto_sign_ed25519_sk_to_curve25519","crypto_sign_ed25519_sk_to_pk","crypto_sign_ed25519_sk_to_seed","crypto_sign_final_create","crypto_sign_final_verify","crypto_sign_init","crypto_sign_keypair","crypto_sign_open","crypto_sign_seed_keypair","crypto_sign_update","crypto_sign_verify_detached","crypto_stream_chacha20","crypto_stream_chacha20_ietf_xor","crypto_stream_chacha20_ietf_xor_ic","crypto_stream_chacha20_keygen","crypto_stream_chacha20_xor","crypto_stream_chacha20_xor_ic","crypto_stream_keygen","crypto_stream_xchacha20_keygen","crypto_stream_xchacha20_xor","crypto_stream_xchacha20_xor_ic","randombytes_buf","randombytes_buf_deterministic","randombytes_close","randombytes_random","randombytes_set_implementation","randombytes_stir","randombytes_uniform","sodium_version_string"],a=[E,x,k,S,T,w,Y,B,A,K,M,I,N,L,U,O,C,R,P,G,X,D,F,V,H,q,j,z,W,J,Q,Z,$,ee,re,te,ae,_e,se,ne,ce,oe,he,pe,ye,ie,le,ue,de,ve,ge,be,fe,me,Ee,xe,ke,Se,Te,we,Ye,Be,Ae,Ke,Me,Ie,Ne,Le,Ue,Oe,Ce,Re,Pe,Ge,Xe,De,Fe,Ve,He,qe,je,ze,We,Je,Qe,Ze,$e,er,rr,tr,ar,_r,sr,nr,cr,or,hr,pr,yr,ir,lr,ur,dr,vr,gr,br,fr,mr,Er,xr,kr,Sr,Tr,wr,Yr,Br,Ar,Kr,Mr,Ir,Nr,Lr,Ur,Or,Cr,Rr,Pr,Gr,Xr,Dr,Fr,Vr,Hr,qr,jr,zr,Wr,Jr,Qr,Zr,$r,et,rt,tt,at,_t,st,nt,ct,ot,ht,pt,yt,it,lt,ut,dt,vt,gt,bt,ft,mt],_=0;_<a.length;_++)"function"==typeof t["_"+r[_]]&&(e[r[_]]=a[_]);var s=["SODIUM_LIBRARY_VERSION_MAJOR","SODIUM_LIBRARY_VERSION_MINOR","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_salsa20_CONSTBYTES","crypto_core_salsa20_INPUTBYTES","crypto_core_salsa20_KEYBYTES","crypto_core_salsa20_OUTPUTBYTES","crypto_generichash_BYTES","crypto_generichash_BYTES_MAX","crypto_generichash_BYTES_MIN","crypto_generichash_KEYBYTES","crypto_generichash_KEYBYTES_MAX","crypto_generichash_KEYBYTES_MIN","crypto_generichash_blake2b_BYTES","crypto_generichash_blake2b_BYTES_MAX","crypto_generichash_blake2b_BYTES_MIN","crypto_generichash_blake2b_KEYBYTES","crypto_generichash_blake2b_KEYBYTES_MAX","crypto_generichash_blake2b_KEYBYTES_MIN","crypto_generichash_blake2b_PERSONALBYTES","crypto_generichash_blake2b_SALTBYTES","crypto_hash_BYTES","crypto_hash_sha256_BYTES","crypto_hash_sha512_BYTES","crypto_kdf_BYTES_MAX","crypto_kdf_BYTES_MIN","crypto_kdf_CONTEXTBYTES","crypto_kdf_KEYBYTES","crypto_kdf_blake2b_BYTES_MAX","crypto_kdf_blake2b_BYTES_MIN","crypto_kdf_blake2b_CONTEXTBYTES","crypto_kdf_blake2b_KEYBYTES","crypto_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_SALTBYTES","crypto_pwhash_argon2i_STRBYTES","crypto_pwhash_argon2id_BYTES_MAX","crypto_pwhash_argon2id_BYTES_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_SALTBYTES","crypto_pwhash_scryptsalsa208sha256_STRBYTES","crypto_scalarmult_BYTES","crypto_scalarmult_SCALARBYTES","crypto_scalarmult_curve25519_BYTES","crypto_scalarmult_curve25519_SCALARBYTES","crypto_scalarmult_ed25519_BYTES","crypto_scalarmult_ed25519_SCALARBYTES","crypto_scalarmult_ristretto255_BYTES","crypto_scalarmult_ristretto255_SCALARBYTES","crypto_secretbox_KEYBYTES","crypto_secretbox_MACBYTES","crypto_secretbox_MESSAGEBYTES_MAX","crypto_secretbox_NONCEBYTES","crypto_secretbox_xchacha20poly1305_KEYBYTES","crypto_secretbox_xchacha20poly1305_MACBYTES","crypto_secretbox_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretbox_xchacha20poly1305_NONCEBYTES","crypto_secretbox_xsalsa20poly1305_KEYBYTES","crypto_secretbox_xsalsa20poly1305_MACBYTES","crypto_secretbox_xsalsa20poly1305_MESSAGEBYTES_MAX","crypto_secretbox_xsalsa20poly1305_NONCEBYTES","crypto_secretstream_xchacha20poly1305_ABYTES","crypto_secretstream_xchacha20poly1305_HEADERBYTES","crypto_secretstream_xchacha20poly1305_KEYBYTES","crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX","crypto_secretstream_xchacha20poly1305_TAG_FINAL","crypto_secretstream_xchacha20poly1305_TAG_MESSAGE","crypto_secretstream_xchacha20poly1305_TAG_PUSH","crypto_secretstream_xchacha20poly1305_TAG_REKEY","crypto_shorthash_BYTES","crypto_shorthash_KEYBYTES","crypto_shorthash_siphash24_BYTES","crypto_shorthash_siphash24_KEYBYTES","crypto_shorthash_siphashx24_BYTES","crypto_shorthash_siphashx24_KEYBYTES","crypto_sign_BYTES","crypto_sign_MESSAGEBYTES_MAX","crypto_sign_PUBLICKEYBYTES","crypto_sign_SECRETKEYBYTES","crypto_sign_SEEDBYTES","crypto_sign_ed25519_BYTES","crypto_sign_ed25519_MESSAGEBYTES_MAX","crypto_sign_ed25519_PUBLICKEYBYTES","crypto_sign_ed25519_SECRETKEYBYTES","crypto_sign_ed25519_SEEDBYTES","crypto_stream_KEYBYTES","crypto_stream_MESSAGEBYTES_MAX","crypto_stream_NONCEBYTES","crypto_stream_chacha20_IETF_KEYBYTES","crypto_stream_chacha20_IETF_MESSAGEBYTES_MAX","crypto_stream_chacha20_IETF_NONCEBYTES","crypto_stream_chacha20_KEYBYTES","crypto_stream_chacha20_MESSAGEBYTES_MAX","crypto_stream_chacha20_NONCEBYTES","crypto_stream_chacha20_ietf_KEYBYTES","crypto_stream_chacha20_ietf_MESSAGEBYTES_MAX","crypto_stream_chacha20_ietf_NONCEBYTES","crypto_stream_salsa2012_KEYBYTES","crypto_stream_salsa2012_MESSAGEBYTES_MAX","crypto_stream_salsa2012_NONCEBYTES","crypto_stream_salsa208_KEYBYTES","crypto_stream_salsa208_MESSAGEBYTES_MAX","crypto_stream_salsa208_NONCEBYTES","crypto_stream_salsa20_KEYBYTES","crypto_stream_salsa20_MESSAGEBYTES_MAX","crypto_stream_salsa20_NONCEBYTES","crypto_stream_xchacha20_KEYBYTES","crypto_stream_xchacha20_MESSAGEBYTES_MAX","crypto_stream_xchacha20_NONCEBYTES","crypto_stream_xsalsa20_KEYBYTES","crypto_stream_xsalsa20_MESSAGEBYTES_MAX","crypto_stream_xsalsa20_NONCEBYTES","crypto_verify_16_BYTES","crypto_verify_32_BYTES","crypto_verify_64_BYTES"];for(_=0;_<s.length;_++)"function"==typeof(c=t["_"+s[_].toLowerCase()])&&(e[s[_]]=c());var n=["SODIUM_VERSION_STRING","crypto_pwhash_STRPREFIX","crypto_pwhash_scryptsalsa208sha256_STRPREFIX"];for(_=0;_<n.length;_++){var c;"function"==typeof(c=t["_"+n[_].toLowerCase()])&&(e[n[_]]=t.UTF8ToString(c()))}}t=r;try{a();var _=new Uint8Array([98,97,108,108,115]),s=e.randombytes_buf(e.crypto_secretbox_NONCEBYTES),n=e.randombytes_buf(e.crypto_secretbox_KEYBYTES),c=e.crypto_secretbox_easy(_,s,n),o=e.crypto_secretbox_open_easy(c,s,n);if(e.memcmp(_,o))return}catch(e){if(null==t.useBackupModule)throw new Error("Both wasm and asm failed to load"+e)}t.useBackupModule(),a()}));function _(e){if("function"==typeof TextEncoder)return(new TextEncoder).encode(e);e=unescape(encodeURIComponent(e));for(var r=new Uint8Array(e.length),t=0,a=e.length;t<a;t++)r[t]=e.charCodeAt(t);return r}function s(e){if("function"==typeof TextDecoder)return new TextDecoder("utf-8",{fatal:!0}).decode(e);var r=8192,t=Math.ceil(e.length/r);if(t<=1)try{return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}catch(e){throw new TypeError("The encoded data was not valid.")}for(var a="",_=0,n=0;n<t;n++){var c=Array.prototype.slice.call(e,n*r+_,(n+1)*r+_);if(0!=c.length){var o,h=c.length,p=0;do{var y=c[--h];y>=240?(p=4,o=!0):y>=224?(p=3,o=!0):y>=192?(p=2,o=!0):y<128&&(p=1,o=!0)}while(!o);for(var i=p-(c.length-h),l=0;l<i;l++)_--,c.pop();a+=s(c)}}return a}function n(e){e=m(null,e,"input");for(var r,t,a,_="",s=0;s<e.length;s++)a=87+(t=15&e[s])+(t-10>>8&-39)<<8|87+(r=e[s]>>>4)+(r-10>>8&-39),_+=String.fromCharCode(255&a)+String.fromCharCode(a>>>8);return _}var c={ORIGINAL:1,ORIGINAL_NO_PADDING:3,URLSAFE:5,URLSAFE_NO_PADDING:7};function o(e){if(null==e)return c.URLSAFE_NO_PADDING;if(e!==c.ORIGINAL&&e!==c.ORIGINAL_NO_PADDING&&e!==c.URLSAFE&&e!=c.URLSAFE_NO_PADDING)throw new Error("unsupported base64 variant");return e}function h(e,r){r=o(r),e=m(_,e,"input");var a,_=[],n=0|Math.floor(e.length/3),c=e.length-3*n,h=4*n+(0!==c?0==(2&r)?4:2+(c>>>1):0),p=new l(h+1),y=u(e);return _.push(y),_.push(p.address),0===t._sodium_bin2base64(p.address,p.length,y,e.length,r)&&g(_,"conversion failed"),p.length=h,a=s(p.to_Uint8Array()),v(_),a}function p(e,r){var t=r||"uint8array";if(!y(t))throw new Error(t+" output format is not available");if(e instanceof l){if("uint8array"===t)return e.to_Uint8Array();if("text"===t)return s(e.to_Uint8Array());if("hex"===t)return n(e.to_Uint8Array());if("base64"===t)return h(e.to_Uint8Array(),c.URLSAFE_NO_PADDING);throw new Error('What is output format "'+t+'"?')}if("object"==typeof e){for(var a=Object.keys(e),_={},o=0;o<a.length;o++)_[a[o]]=p(e[a[o]],t);return _}if("string"==typeof e)return e;throw new TypeError("Cannot format output")}function y(e){for(var r=["uint8array","text","hex","base64"],t=0;t<r.length;t++)if(r[t]===e)return!0;return!1}function i(e){if(e){if("string"!=typeof e)throw new TypeError("When defined, the output format must be a string");if(!y(e))throw new Error(e+" is not a supported output format")}}function l(e){this.length=e,this.address=d(e)}function u(e){var r=d(e.length);return t.HEAPU8.set(e,r),r}function d(e){var r=t._malloc(e);if(0===r)throw{message:"_malloc() failed",length:e};return r}function v(e){if(e)for(var r=0;r<e.length;r++)a=e[r],t._free(a);var a}function g(e,r){throw v(e),new Error(r)}function b(e,r){throw v(e),new TypeError(r)}function f(e,r,t){null==r&&b(e,t+" cannot be null or undefined")}function m(e,r,t){return f(e,r,t),r instanceof Uint8Array?r:"string"==typeof r?_(r):void b(e,"unsupported input type for "+t)}function E(e,r,a,_,s,n){var c=[];i(n);var o=null;null!=e&&(o=u(e=m(c,e,"secret_nonce")),e.length,c.push(o)),r=m(c,r,"ciphertext");var h,y=t._crypto_aead_chacha20poly1305_abytes(),d=r.length;d<y&&b(c,"ciphertext is too short"),h=u(r),c.push(h);var f=null,E=0;null!=a&&(f=u(a=m(c,a,"additional_data")),E=a.length,c.push(f)),_=m(c,_,"public_nonce");var x,k=0|t._crypto_aead_chacha20poly1305_npubbytes();_.length!==k&&b(c,"invalid public_nonce length"),x=u(_),c.push(x),s=m(c,s,"key");var S,T=0|t._crypto_aead_chacha20poly1305_keybytes();s.length!==T&&b(c,"invalid key length"),S=u(s),c.push(S);var w=new l(d-t._crypto_aead_chacha20poly1305_abytes()|0),Y=w.address;if(c.push(Y),0===t._crypto_aead_chacha20poly1305_decrypt(Y,null,o,h,d,0,f,E,0,x,S)){var B=p(w,n);return v(c),B}g(c,"ciphertext cannot be decrypted using that key")}function x(e,r,a,_,s,n,c){var o=[];i(c);var h=null;null!=e&&(h=u(e=m(o,e,"secret_nonce")),e.length,o.push(h));var y=u(r=m(o,r,"ciphertext")),d=r.length;o.push(y),a=m(o,a,"mac");var f,E=0|t._crypto_box_macbytes();a.length!==E&&b(o,"invalid mac length"),f=u(a),o.push(f);var x=null,k=0;null!=_&&(x=u(_=m(o,_,"additional_data")),k=_.length,o.push(x)),s=m(o,s,"public_nonce");var S,T=0|t._crypto_aead_chacha20poly1305_npubbytes();s.length!==T&&b(o,"invalid public_nonce length"),S=u(s),o.push(S),n=m(o,n,"key");var w,Y=0|t._crypto_aead_chacha20poly1305_keybytes();n.length!==Y&&b(o,"invalid key length"),w=u(n),o.push(w);var B=new l(0|d),A=B.address;if(o.push(A),0===t._crypto_aead_chacha20poly1305_decrypt_detached(A,h,y,d,0,f,x,k,0,S,w)){var K=p(B,c);return v(o),K}g(o,"ciphertext cannot be decrypted using that key")}function k(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_chacha20poly1305_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_chacha20poly1305_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(h+t._crypto_aead_chacha20poly1305_abytes()|0),w=T.address;if(c.push(w),0===t._crypto_aead_chacha20poly1305_encrypt(w,null,o,h,0,y,d,0,f,E,k)){var Y=p(T,n);return v(c),Y}g(c,"invalid usage")}function S(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_chacha20poly1305_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_chacha20poly1305_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(0|h),w=T.address;c.push(w);var Y=new l(0|t._crypto_aead_chacha20poly1305_abytes()),B=Y.address;if(c.push(B),0===t._crypto_aead_chacha20poly1305_encrypt_detached(w,B,null,o,h,0,y,d,0,f,E,k)){var A=p({ciphertext:T,mac:Y},n);return v(c),A}g(c,"invalid usage")}function T(e,r,a,_,s,n){var c=[];i(n);var o=null;null!=e&&(o=u(e=m(c,e,"secret_nonce")),e.length,c.push(o)),r=m(c,r,"ciphertext");var h,y=t._crypto_aead_chacha20poly1305_ietf_abytes(),d=r.length;d<y&&b(c,"ciphertext is too short"),h=u(r),c.push(h);var f=null,E=0;null!=a&&(f=u(a=m(c,a,"additional_data")),E=a.length,c.push(f)),_=m(c,_,"public_nonce");var x,k=0|t._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==k&&b(c,"invalid public_nonce length"),x=u(_),c.push(x),s=m(c,s,"key");var S,T=0|t._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==T&&b(c,"invalid key length"),S=u(s),c.push(S);var w=new l(d-t._crypto_aead_chacha20poly1305_ietf_abytes()|0),Y=w.address;if(c.push(Y),0===t._crypto_aead_chacha20poly1305_ietf_decrypt(Y,null,o,h,d,0,f,E,0,x,S)){var B=p(w,n);return v(c),B}g(c,"ciphertext cannot be decrypted using that key")}function w(e,r,a,_,s,n,c){var o=[];i(c);var h=null;null!=e&&(h=u(e=m(o,e,"secret_nonce")),e.length,o.push(h));var y=u(r=m(o,r,"ciphertext")),d=r.length;o.push(y),a=m(o,a,"mac");var f,E=0|t._crypto_box_macbytes();a.length!==E&&b(o,"invalid mac length"),f=u(a),o.push(f);var x=null,k=0;null!=_&&(x=u(_=m(o,_,"additional_data")),k=_.length,o.push(x)),s=m(o,s,"public_nonce");var S,T=0|t._crypto_aead_chacha20poly1305_ietf_npubbytes();s.length!==T&&b(o,"invalid public_nonce length"),S=u(s),o.push(S),n=m(o,n,"key");var w,Y=0|t._crypto_aead_chacha20poly1305_ietf_keybytes();n.length!==Y&&b(o,"invalid key length"),w=u(n),o.push(w);var B=new l(0|d),A=B.address;if(o.push(A),0===t._crypto_aead_chacha20poly1305_ietf_decrypt_detached(A,h,y,d,0,f,x,k,0,S,w)){var K=p(B,c);return v(o),K}g(o,"ciphertext cannot be decrypted using that key")}function Y(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(h+t._crypto_aead_chacha20poly1305_ietf_abytes()|0),w=T.address;if(c.push(w),0===t._crypto_aead_chacha20poly1305_ietf_encrypt(w,null,o,h,0,y,d,0,f,E,k)){var Y=p(T,n);return v(c),Y}g(c,"invalid usage")}function B(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_chacha20poly1305_ietf_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_chacha20poly1305_ietf_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(0|h),w=T.address;c.push(w);var Y=new l(0|t._crypto_aead_chacha20poly1305_ietf_abytes()),B=Y.address;if(c.push(B),0===t._crypto_aead_chacha20poly1305_ietf_encrypt_detached(w,B,null,o,h,0,y,d,0,f,E,k)){var A=p({ciphertext:T,mac:Y},n);return v(c),A}g(c,"invalid usage")}function A(e){var r=[];i(e);var a=new l(0|t._crypto_aead_chacha20poly1305_ietf_keybytes()),_=a.address;r.push(_),t._crypto_aead_chacha20poly1305_ietf_keygen(_);var s=p(a,e);return v(r),s}function K(e){var r=[];i(e);var a=new l(0|t._crypto_aead_chacha20poly1305_keybytes()),_=a.address;r.push(_),t._crypto_aead_chacha20poly1305_keygen(_);var s=p(a,e);return v(r),s}function M(e,r,a,_,s,n){var c=[];i(n);var o=null;null!=e&&(o=u(e=m(c,e,"secret_nonce")),e.length,c.push(o)),r=m(c,r,"ciphertext");var h,y=t._crypto_aead_xchacha20poly1305_ietf_abytes(),d=r.length;d<y&&b(c,"ciphertext is too short"),h=u(r),c.push(h);var f=null,E=0;null!=a&&(f=u(a=m(c,a,"additional_data")),E=a.length,c.push(f)),_=m(c,_,"public_nonce");var x,k=0|t._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==k&&b(c,"invalid public_nonce length"),x=u(_),c.push(x),s=m(c,s,"key");var S,T=0|t._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==T&&b(c,"invalid key length"),S=u(s),c.push(S);var w=new l(d-t._crypto_aead_xchacha20poly1305_ietf_abytes()|0),Y=w.address;if(c.push(Y),0===t._crypto_aead_xchacha20poly1305_ietf_decrypt(Y,null,o,h,d,0,f,E,0,x,S)){var B=p(w,n);return v(c),B}g(c,"ciphertext cannot be decrypted using that key")}function I(e,r,a,_,s,n,c){var o=[];i(c);var h=null;null!=e&&(h=u(e=m(o,e,"secret_nonce")),e.length,o.push(h));var y=u(r=m(o,r,"ciphertext")),d=r.length;o.push(y),a=m(o,a,"mac");var f,E=0|t._crypto_box_macbytes();a.length!==E&&b(o,"invalid mac length"),f=u(a),o.push(f);var x=null,k=0;null!=_&&(x=u(_=m(o,_,"additional_data")),k=_.length,o.push(x)),s=m(o,s,"public_nonce");var S,T=0|t._crypto_aead_xchacha20poly1305_ietf_npubbytes();s.length!==T&&b(o,"invalid public_nonce length"),S=u(s),o.push(S),n=m(o,n,"key");var w,Y=0|t._crypto_aead_xchacha20poly1305_ietf_keybytes();n.length!==Y&&b(o,"invalid key length"),w=u(n),o.push(w);var B=new l(0|d),A=B.address;if(o.push(A),0===t._crypto_aead_xchacha20poly1305_ietf_decrypt_detached(A,h,y,d,0,f,x,k,0,S,w)){var K=p(B,c);return v(o),K}g(o,"ciphertext cannot be decrypted using that key")}function N(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(h+t._crypto_aead_xchacha20poly1305_ietf_abytes()|0),w=T.address;if(c.push(w),0===t._crypto_aead_xchacha20poly1305_ietf_encrypt(w,null,o,h,0,y,d,0,f,E,k)){var Y=p(T,n);return v(c),Y}g(c,"invalid usage")}function L(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"message")),h=e.length;c.push(o);var y=null,d=0;null!=r&&(y=u(r=m(c,r,"additional_data")),d=r.length,c.push(y));var f=null;null!=a&&(f=u(a=m(c,a,"secret_nonce")),a.length,c.push(f)),_=m(c,_,"public_nonce");var E,x=0|t._crypto_aead_xchacha20poly1305_ietf_npubbytes();_.length!==x&&b(c,"invalid public_nonce length"),E=u(_),c.push(E),s=m(c,s,"key");var k,S=0|t._crypto_aead_xchacha20poly1305_ietf_keybytes();s.length!==S&&b(c,"invalid key length"),k=u(s),c.push(k);var T=new l(0|h),w=T.address;c.push(w);var Y=new l(0|t._crypto_aead_xchacha20poly1305_ietf_abytes()),B=Y.address;if(c.push(B),0===t._crypto_aead_xchacha20poly1305_ietf_encrypt_detached(w,B,null,o,h,0,y,d,0,f,E,k)){var A=p({ciphertext:T,mac:Y},n);return v(c),A}g(c,"invalid usage")}function U(e){var r=[];i(e);var a=new l(0|t._crypto_aead_xchacha20poly1305_ietf_keybytes()),_=a.address;r.push(_),t._crypto_aead_xchacha20poly1305_ietf_keygen(_);var s=p(a,e);return v(r),s}function O(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_auth_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_auth_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_auth(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function C(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_auth_hmacsha256_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_auth_hmacsha256_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_auth_hmacsha256(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function R(e,r){var a=[];i(r),f(a,e,"state_address");var _=new l(0|t._crypto_auth_hmacsha256_bytes()),s=_.address;if(a.push(s),0==(0|t._crypto_auth_hmacsha256_final(e,s))){var n=(t._free(e),p(_,r));return v(a),n}g(a,"invalid usage")}function P(e,r){var a=[];i(r);var _=null,s=0;null!=e&&(_=u(e=m(a,e,"key")),s=e.length,a.push(_));var n=new l(208).address;if(0==(0|t._crypto_auth_hmacsha256_init(n,_,s))){var c=n;return v(a),c}g(a,"invalid usage")}function G(e){var r=[];i(e);var a=new l(0|t._crypto_auth_hmacsha256_keybytes()),_=a.address;r.push(_),t._crypto_auth_hmacsha256_keygen(_);var s=p(a,e);return v(r),s}function X(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_auth_hmacsha256_update(e,s,n))&&g(_,"invalid usage"),v(_)}function D(e,r,a){var _=[];e=m(_,e,"tag");var s,n=0|t._crypto_auth_hmacsha256_bytes();e.length!==n&&b(_,"invalid tag length"),s=u(e),_.push(s);var c=u(r=m(_,r,"message")),o=r.length;_.push(c),a=m(_,a,"key");var h,p=0|t._crypto_auth_hmacsha256_keybytes();a.length!==p&&b(_,"invalid key length"),h=u(a),_.push(h);var y=0==(0|t._crypto_auth_hmacsha256_verify(s,c,o,0,h));return v(_),y}function F(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_auth_hmacsha512_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_auth_hmacsha512_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_auth_hmacsha512(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function V(e,r){var a=[];i(r),f(a,e,"state_address");var _=new l(0|t._crypto_auth_hmacsha512_bytes()),s=_.address;if(a.push(s),0==(0|t._crypto_auth_hmacsha512_final(e,s))){var n=(t._free(e),p(_,r));return v(a),n}g(a,"invalid usage")}function H(e,r){var a=[];i(r);var _=null,s=0;null!=e&&(_=u(e=m(a,e,"key")),s=e.length,a.push(_));var n=new l(416).address;if(0==(0|t._crypto_auth_hmacsha512_init(n,_,s))){var c=n;return v(a),c}g(a,"invalid usage")}function q(e){var r=[];i(e);var a=new l(0|t._crypto_auth_hmacsha512_keybytes()),_=a.address;r.push(_),t._crypto_auth_hmacsha512_keygen(_);var s=p(a,e);return v(r),s}function j(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_auth_hmacsha512_update(e,s,n))&&g(_,"invalid usage"),v(_)}function z(e,r,a){var _=[];e=m(_,e,"tag");var s,n=0|t._crypto_auth_hmacsha512_bytes();e.length!==n&&b(_,"invalid tag length"),s=u(e),_.push(s);var c=u(r=m(_,r,"message")),o=r.length;_.push(c),a=m(_,a,"key");var h,p=0|t._crypto_auth_hmacsha512_keybytes();a.length!==p&&b(_,"invalid key length"),h=u(a),_.push(h);var y=0==(0|t._crypto_auth_hmacsha512_verify(s,c,o,0,h));return v(_),y}function W(e){var r=[];i(e);var a=new l(0|t._crypto_auth_keybytes()),_=a.address;r.push(_),t._crypto_auth_keygen(_);var s=p(a,e);return v(r),s}function J(e,r,a){var _=[];e=m(_,e,"tag");var s,n=0|t._crypto_auth_bytes();e.length!==n&&b(_,"invalid tag length"),s=u(e),_.push(s);var c=u(r=m(_,r,"message")),o=r.length;_.push(c),a=m(_,a,"key");var h,p=0|t._crypto_auth_keybytes();a.length!==p&&b(_,"invalid key length"),h=u(a),_.push(h);var y=0==(0|t._crypto_auth_verify(s,c,o,0,h));return v(_),y}function Q(e,r,a){var _=[];i(a),e=m(_,e,"publicKey");var s,n=0|t._crypto_box_publickeybytes();e.length!==n&&b(_,"invalid publicKey length"),s=u(e),_.push(s),r=m(_,r,"privateKey");var c,o=0|t._crypto_box_secretkeybytes();r.length!==o&&b(_,"invalid privateKey length"),c=u(r),_.push(c);var h=new l(0|t._crypto_box_beforenmbytes()),y=h.address;if(_.push(y),0==(0|t._crypto_box_beforenm(y,s,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function Z(e){var r=[];i(e);var a=new l(0|t._crypto_box_curve25519xchacha20poly1305_publickeybytes()),_=a.address;r.push(_);var s=new l(0|t._crypto_box_curve25519xchacha20poly1305_secretkeybytes()),n=s.address;r.push(n),t._crypto_box_curve25519xchacha20poly1305_keypair(_,n);var c=p({publicKey:a,privateKey:s,keyType:"curve25519"},e);return v(r),c}function $(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"publicKey");var c,o=0|t._crypto_box_curve25519xchacha20poly1305_publickeybytes();r.length!==o&&b(_,"invalid publicKey length"),c=u(r),_.push(c);var h=new l(n+t._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),y=h.address;_.push(y),t._crypto_box_curve25519xchacha20poly1305_seal(y,s,n,0,c);var d=p(h,a);return v(_),d}function ee(e,r,a,_){var s=[];i(_),e=m(s,e,"ciphertext");var n,c=t._crypto_box_curve25519xchacha20poly1305_sealbytes(),o=e.length;o<c&&b(s,"ciphertext is too short"),n=u(e),s.push(n),r=m(s,r,"publicKey");var h,y=0|t._crypto_box_curve25519xchacha20poly1305_publickeybytes();r.length!==y&&b(s,"invalid publicKey length"),h=u(r),s.push(h),a=m(s,a,"secretKey");var d,g=0|t._crypto_box_curve25519xchacha20poly1305_secretkeybytes();a.length!==g&&b(s,"invalid secretKey length"),d=u(a),s.push(d);var f=new l(o-t._crypto_box_curve25519xchacha20poly1305_sealbytes()|0),E=f.address;s.push(E),t._crypto_box_curve25519xchacha20poly1305_seal_open(E,n,o,0,h,d);var x=p(f,_);return v(s),x}function re(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"message")),o=e.length;n.push(c),r=m(n,r,"nonce");var h,y=0|t._crypto_box_noncebytes();r.length!==y&&b(n,"invalid nonce length"),h=u(r),n.push(h),a=m(n,a,"publicKey");var d,f=0|t._crypto_box_publickeybytes();a.length!==f&&b(n,"invalid publicKey length"),d=u(a),n.push(d),_=m(n,_,"privateKey");var E,x=0|t._crypto_box_secretkeybytes();_.length!==x&&b(n,"invalid privateKey length"),E=u(_),n.push(E);var k=new l(0|o),S=k.address;n.push(S);var T=new l(0|t._crypto_box_macbytes()),w=T.address;if(n.push(w),0==(0|t._crypto_box_detached(S,w,c,o,0,h,d,E))){var Y=p({ciphertext:k,mac:T},s);return v(n),Y}g(n,"invalid usage")}function te(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"message")),o=e.length;n.push(c),r=m(n,r,"nonce");var h,y=0|t._crypto_box_noncebytes();r.length!==y&&b(n,"invalid nonce length"),h=u(r),n.push(h),a=m(n,a,"publicKey");var d,f=0|t._crypto_box_publickeybytes();a.length!==f&&b(n,"invalid publicKey length"),d=u(a),n.push(d),_=m(n,_,"privateKey");var E,x=0|t._crypto_box_secretkeybytes();_.length!==x&&b(n,"invalid privateKey length"),E=u(_),n.push(E);var k=new l(o+t._crypto_box_macbytes()|0),S=k.address;if(n.push(S),0==(0|t._crypto_box_easy(S,c,o,0,h,d,E))){var T=p(k,s);return v(n),T}g(n,"invalid usage")}function ae(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_box_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"sharedKey");var y,d=0|t._crypto_box_beforenmbytes();a.length!==d&&b(s,"invalid sharedKey length"),y=u(a),s.push(y);var f=new l(c+t._crypto_box_macbytes()|0),E=f.address;if(s.push(E),0==(0|t._crypto_box_easy_afternm(E,n,c,0,o,y))){var x=p(f,_);return v(s),x}g(s,"invalid usage")}function _e(e){var r=[];i(e);var a=new l(0|t._crypto_box_publickeybytes()),_=a.address;r.push(_);var s=new l(0|t._crypto_box_secretkeybytes()),n=s.address;if(r.push(n),0==(0|t._crypto_box_keypair(_,n))){var c={publicKey:p(a,e),privateKey:p(s,e),keyType:"x25519"};return v(r),c}g(r,"internal error")}function se(e,r,a,_,s,n){var c=[];i(n);var o=u(e=m(c,e,"ciphertext")),h=e.length;c.push(o),r=m(c,r,"mac");var y,d=0|t._crypto_box_macbytes();r.length!==d&&b(c,"invalid mac length"),y=u(r),c.push(y),a=m(c,a,"nonce");var f,E=0|t._crypto_box_noncebytes();a.length!==E&&b(c,"invalid nonce length"),f=u(a),c.push(f),_=m(c,_,"publicKey");var x,k=0|t._crypto_box_publickeybytes();_.length!==k&&b(c,"invalid publicKey length"),x=u(_),c.push(x),s=m(c,s,"privateKey");var S,T=0|t._crypto_box_secretkeybytes();s.length!==T&&b(c,"invalid privateKey length"),S=u(s),c.push(S);var w=new l(0|h),Y=w.address;if(c.push(Y),0==(0|t._crypto_box_open_detached(Y,o,y,h,0,f,x,S))){var B=p(w,n);return v(c),B}g(c,"incorrect key pair for the given ciphertext")}function ne(e,r,a,_,s){var n=[];i(s),e=m(n,e,"ciphertext");var c,o=t._crypto_box_macbytes(),h=e.length;h<o&&b(n,"ciphertext is too short"),c=u(e),n.push(c),r=m(n,r,"nonce");var y,d=0|t._crypto_box_noncebytes();r.length!==d&&b(n,"invalid nonce length"),y=u(r),n.push(y),a=m(n,a,"publicKey");var f,E=0|t._crypto_box_publickeybytes();a.length!==E&&b(n,"invalid publicKey length"),f=u(a),n.push(f),_=m(n,_,"privateKey");var x,k=0|t._crypto_box_secretkeybytes();_.length!==k&&b(n,"invalid privateKey length"),x=u(_),n.push(x);var S=new l(h-t._crypto_box_macbytes()|0),T=S.address;if(n.push(T),0==(0|t._crypto_box_open_easy(T,c,h,0,y,f,x))){var w=p(S,s);return v(n),w}g(n,"incorrect key pair for the given ciphertext")}function ce(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"ciphertext")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_box_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"sharedKey");var y,d=0|t._crypto_box_beforenmbytes();a.length!==d&&b(s,"invalid sharedKey length"),y=u(a),s.push(y);var f=new l(c-t._crypto_box_macbytes()|0),E=f.address;if(s.push(E),0==(0|t._crypto_box_open_easy_afternm(E,n,c,0,o,y))){var x=p(f,_);return v(s),x}g(s,"incorrect secret key for the given ciphertext")}function oe(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"publicKey");var c,o=0|t._crypto_box_publickeybytes();r.length!==o&&b(_,"invalid publicKey length"),c=u(r),_.push(c);var h=new l(n+t._crypto_box_sealbytes()|0),y=h.address;if(_.push(y),0==(0|t._crypto_box_seal(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function he(e,r,a,_){var s=[];i(_),e=m(s,e,"ciphertext");var n,c=t._crypto_box_sealbytes(),o=e.length;o<c&&b(s,"ciphertext is too short"),n=u(e),s.push(n),r=m(s,r,"publicKey");var h,y=0|t._crypto_box_publickeybytes();r.length!==y&&b(s,"invalid publicKey length"),h=u(r),s.push(h),a=m(s,a,"privateKey");var d,f=0|t._crypto_box_secretkeybytes();a.length!==f&&b(s,"invalid privateKey length"),d=u(a),s.push(d);var E=new l(o-t._crypto_box_sealbytes()|0),x=E.address;if(s.push(x),0==(0|t._crypto_box_seal_open(x,n,o,0,h,d))){var k=p(E,_);return v(s),k}g(s,"incorrect key pair for the given ciphertext")}function pe(e,r){var a=[];i(r),e=m(a,e,"seed");var _,s=0|t._crypto_box_seedbytes();e.length!==s&&b(a,"invalid seed length"),_=u(e),a.push(_);var n=new l(0|t._crypto_box_publickeybytes()),c=n.address;a.push(c);var o=new l(0|t._crypto_box_secretkeybytes()),h=o.address;if(a.push(h),0==(0|t._crypto_box_seed_keypair(c,h,_))){var y={publicKey:p(n,r),privateKey:p(o,r),keyType:"x25519"};return v(a),y}g(a,"invalid usage")}function ye(e,r,a){var _=[];i(a),e=m(_,e,"p");var s,n=0|t._crypto_core_ed25519_bytes();e.length!==n&&b(_,"invalid p length"),s=u(e),_.push(s),r=m(_,r,"q");var c,o=0|t._crypto_core_ed25519_bytes();r.length!==o&&b(_,"invalid q length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ed25519_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_core_ed25519_add(y,s,c))){var d=p(h,a);return v(_),d}g(_,"input is an invalid element")}function ie(e,r){var a=[];i(r);var _=u(e=m(a,e,"r"));e.length,a.push(_);var s=new l(0|t._crypto_core_ed25519_bytes()),n=s.address;if(a.push(n),0==(0|t._crypto_core_ed25519_from_hash(n,_))){var c=p(s,r);return v(a),c}g(a,"invalid usage")}function le(e,r){var a=[];i(r);var _=u(e=m(a,e,"r"));e.length,a.push(_);var s=new l(0|t._crypto_core_ed25519_bytes()),n=s.address;if(a.push(n),0==(0|t._crypto_core_ed25519_from_uniform(n,_))){var c=p(s,r);return v(a),c}g(a,"invalid usage")}function ue(e,r){var a=[];i(r),e=m(a,e,"repr");var _,s=0|t._crypto_core_ed25519_bytes();e.length!==s&&b(a,"invalid repr length"),_=u(e),a.push(_);var n=1==(0|t._crypto_core_ed25519_is_valid_point(_));return v(a),n}function de(e){var r=[];i(e);var a=new l(0|t._crypto_core_ed25519_bytes()),_=a.address;r.push(_),t._crypto_core_ed25519_random(_);var s=p(a,e);return v(r),s}function ve(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ed25519_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ed25519_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ed25519_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ed25519_scalar_add(y,s,c);var d=p(h,a);return v(_),d}function ge(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ed25519_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ed25519_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ed25519_scalar_complement(c,_);var o=p(n,r);return v(a),o}function be(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ed25519_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ed25519_scalarbytes()),c=n.address;if(a.push(c),0==(0|t._crypto_core_ed25519_scalar_invert(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid reciprocate")}function fe(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ed25519_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ed25519_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ed25519_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ed25519_scalar_mul(y,s,c);var d=p(h,a);return v(_),d}function me(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ed25519_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ed25519_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ed25519_scalar_negate(c,_);var o=p(n,r);return v(a),o}function Ee(e){var r=[];i(e);var a=new l(0|t._crypto_core_ed25519_scalarbytes()),_=a.address;r.push(_),t._crypto_core_ed25519_scalar_random(_);var s=p(a,e);return v(r),s}function xe(e,r){var a=[];i(r),e=m(a,e,"sample");var _,s=0|t._crypto_core_ed25519_nonreducedscalarbytes();e.length!==s&&b(a,"invalid sample length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ed25519_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ed25519_scalar_reduce(c,_);var o=p(n,r);return v(a),o}function ke(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ed25519_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ed25519_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ed25519_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ed25519_scalar_sub(y,s,c);var d=p(h,a);return v(_),d}function Se(e,r,a){var _=[];i(a),e=m(_,e,"p");var s,n=0|t._crypto_core_ed25519_bytes();e.length!==n&&b(_,"invalid p length"),s=u(e),_.push(s),r=m(_,r,"q");var c,o=0|t._crypto_core_ed25519_bytes();r.length!==o&&b(_,"invalid q length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ed25519_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_core_ed25519_sub(y,s,c))){var d=p(h,a);return v(_),d}g(_,"input is an invalid element")}function Te(e,r,a,_){var s=[];i(_),e=m(s,e,"input");var n,c=0|t._crypto_core_hchacha20_inputbytes();e.length!==c&&b(s,"invalid input length"),n=u(e),s.push(n),r=m(s,r,"privateKey");var o,h=0|t._crypto_core_hchacha20_keybytes();r.length!==h&&b(s,"invalid privateKey length"),o=u(r),s.push(o);var y=null;null!=a&&(y=u(a=m(s,a,"constant")),a.length,s.push(y));var d=new l(0|t._crypto_core_hchacha20_outputbytes()),f=d.address;if(s.push(f),0==(0|t._crypto_core_hchacha20(f,n,o,y))){var E=p(d,_);return v(s),E}g(s,"invalid usage")}function we(e,r,a,_){var s=[];i(_),e=m(s,e,"input");var n,c=0|t._crypto_core_hsalsa20_inputbytes();e.length!==c&&b(s,"invalid input length"),n=u(e),s.push(n),r=m(s,r,"privateKey");var o,h=0|t._crypto_core_hsalsa20_keybytes();r.length!==h&&b(s,"invalid privateKey length"),o=u(r),s.push(o);var y=null;null!=a&&(y=u(a=m(s,a,"constant")),a.length,s.push(y));var d=new l(0|t._crypto_core_hsalsa20_outputbytes()),f=d.address;if(s.push(f),0==(0|t._crypto_core_hsalsa20(f,n,o,y))){var E=p(d,_);return v(s),E}g(s,"invalid usage")}function Ye(e,r,a){var _=[];i(a),e=m(_,e,"p");var s,n=0|t._crypto_core_ristretto255_bytes();e.length!==n&&b(_,"invalid p length"),s=u(e),_.push(s),r=m(_,r,"q");var c,o=0|t._crypto_core_ristretto255_bytes();r.length!==o&&b(_,"invalid q length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ristretto255_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_core_ristretto255_add(y,s,c))){var d=p(h,a);return v(_),d}g(_,"input is an invalid element")}function Be(e,r){var a=[];i(r);var _=u(e=m(a,e,"r"));e.length,a.push(_);var s=new l(0|t._crypto_core_ristretto255_bytes()),n=s.address;if(a.push(n),0==(0|t._crypto_core_ristretto255_from_hash(n,_))){var c=p(s,r);return v(a),c}g(a,"invalid usage")}function Ae(e,r){var a=[];i(r),e=m(a,e,"repr");var _,s=0|t._crypto_core_ristretto255_bytes();e.length!==s&&b(a,"invalid repr length"),_=u(e),a.push(_);var n=1==(0|t._crypto_core_ristretto255_is_valid_point(_));return v(a),n}function Ke(e){var r=[];i(e);var a=new l(0|t._crypto_core_ristretto255_bytes()),_=a.address;r.push(_),t._crypto_core_ristretto255_random(_);var s=p(a,e);return v(r),s}function Me(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ristretto255_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ristretto255_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ristretto255_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ristretto255_scalar_add(y,s,c);var d=p(h,a);return v(_),d}function Ie(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ristretto255_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ristretto255_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ristretto255_scalar_complement(c,_);var o=p(n,r);return v(a),o}function Ne(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ristretto255_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ristretto255_scalarbytes()),c=n.address;if(a.push(c),0==(0|t._crypto_core_ristretto255_scalar_invert(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid reciprocate")}function Le(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ristretto255_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ristretto255_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ristretto255_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ristretto255_scalar_mul(y,s,c);var d=p(h,a);return v(_),d}function Ue(e,r){var a=[];i(r),e=m(a,e,"s");var _,s=0|t._crypto_core_ristretto255_scalarbytes();e.length!==s&&b(a,"invalid s length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ristretto255_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ristretto255_scalar_negate(c,_);var o=p(n,r);return v(a),o}function Oe(e){var r=[];i(e);var a=new l(0|t._crypto_core_ristretto255_scalarbytes()),_=a.address;r.push(_),t._crypto_core_ristretto255_scalar_random(_);var s=p(a,e);return v(r),s}function Ce(e,r){var a=[];i(r),e=m(a,e,"sample");var _,s=0|t._crypto_core_ristretto255_nonreducedscalarbytes();e.length!==s&&b(a,"invalid sample length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ristretto255_scalarbytes()),c=n.address;a.push(c),t._crypto_core_ristretto255_scalar_reduce(c,_);var o=p(n,r);return v(a),o}function Re(e,r,a){var _=[];i(a),e=m(_,e,"x");var s,n=0|t._crypto_core_ristretto255_scalarbytes();e.length!==n&&b(_,"invalid x length"),s=u(e),_.push(s),r=m(_,r,"y");var c,o=0|t._crypto_core_ristretto255_scalarbytes();r.length!==o&&b(_,"invalid y length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ristretto255_scalarbytes()),y=h.address;_.push(y),t._crypto_core_ristretto255_scalar_sub(y,s,c);var d=p(h,a);return v(_),d}function Pe(e,r,a){var _=[];i(a),e=m(_,e,"p");var s,n=0|t._crypto_core_ristretto255_bytes();e.length!==n&&b(_,"invalid p length"),s=u(e),_.push(s),r=m(_,r,"q");var c,o=0|t._crypto_core_ristretto255_bytes();r.length!==o&&b(_,"invalid q length"),c=u(r),_.push(c);var h=new l(0|t._crypto_core_ristretto255_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_core_ristretto255_sub(y,s,c))){var d=p(h,a);return v(_),d}g(_,"input is an invalid element")}function Ge(e,r,a,_){var s=[];i(_),f(s,e,"hash_length"),("number"!=typeof e||(0|e)!==e||e<0)&&b(s,"hash_length must be an unsigned integer");var n=u(r=m(s,r,"message")),c=r.length;s.push(n);var o=null,h=0;null!=a&&(o=u(a=m(s,a,"key")),h=a.length,s.push(o));var y=new l(e|=0),d=y.address;if(s.push(d),0==(0|t._crypto_generichash(d,e,n,c,0,o,h))){var E=p(y,_);return v(s),E}g(s,"invalid usage")}function Xe(e,r,a,_,s){var n=[];i(s),f(n,e,"subkey_len"),("number"!=typeof e||(0|e)!==e||e<0)&&b(n,"subkey_len must be an unsigned integer");var c=null,o=0;null!=r&&(c=u(r=m(n,r,"key")),o=r.length,n.push(c)),a=m(n,a,"id");var h,y=0|t._crypto_generichash_blake2b_saltbytes();a.length!==y&&b(n,"invalid id length"),h=u(a),n.push(h),_=m(n,_,"ctx");var d,E=0|t._crypto_generichash_blake2b_personalbytes();_.length!==E&&b(n,"invalid ctx length"),d=u(_),n.push(d);var x=new l(0|e),k=x.address;if(n.push(k),0==(0|t._crypto_generichash_blake2b_salt_personal(k,e,null,0,0,c,o,h,d))){var S=p(x,s);return v(n),S}g(n,"invalid usage")}function De(e,r,a){var _=[];i(a),f(_,e,"state_address"),f(_,r,"hash_length"),("number"!=typeof r||(0|r)!==r||r<0)&&b(_,"hash_length must be an unsigned integer");var s=new l(r|=0),n=s.address;if(_.push(n),0==(0|t._crypto_generichash_final(e,n,r))){var c=(t._free(e),p(s,a));return v(_),c}g(_,"invalid usage")}function Fe(e,r,a){var _=[];i(a);var s=null,n=0;null!=e&&(s=u(e=m(_,e,"key")),n=e.length,_.push(s)),f(_,r,"hash_length"),("number"!=typeof r||(0|r)!==r||r<0)&&b(_,"hash_length must be an unsigned integer");var c=new l(357).address;if(0==(0|t._crypto_generichash_init(c,s,n,r))){var o=c;return v(_),o}g(_,"invalid usage")}function Ve(e){var r=[];i(e);var a=new l(0|t._crypto_generichash_keybytes()),_=a.address;r.push(_),t._crypto_generichash_keygen(_);var s=p(a,e);return v(r),s}function He(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_generichash_update(e,s,n))&&g(_,"invalid usage"),v(_)}function qe(e,r){var a=[];i(r);var _=u(e=m(a,e,"message")),s=e.length;a.push(_);var n=new l(0|t._crypto_hash_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_hash(c,_,s,0))){var o=p(n,r);return v(a),o}g(a,"invalid usage")}function je(e,r){var a=[];i(r);var _=u(e=m(a,e,"message")),s=e.length;a.push(_);var n=new l(0|t._crypto_hash_sha256_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_hash_sha256(c,_,s,0))){var o=p(n,r);return v(a),o}g(a,"invalid usage")}function ze(e,r){var a=[];i(r),f(a,e,"state_address");var _=new l(0|t._crypto_hash_sha256_bytes()),s=_.address;if(a.push(s),0==(0|t._crypto_hash_sha256_final(e,s))){var n=(t._free(e),p(_,r));return v(a),n}g(a,"invalid usage")}function We(e){var r=[];i(e);var a=new l(104).address;if(0==(0|t._crypto_hash_sha256_init(a))){var _=a;return v(r),_}g(r,"invalid usage")}function Je(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_hash_sha256_update(e,s,n))&&g(_,"invalid usage"),v(_)}function Qe(e,r){var a=[];i(r);var _=u(e=m(a,e,"message")),s=e.length;a.push(_);var n=new l(0|t._crypto_hash_sha512_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_hash_sha512(c,_,s,0))){var o=p(n,r);return v(a),o}g(a,"invalid usage")}function Ze(e,r){var a=[];i(r),f(a,e,"state_address");var _=new l(0|t._crypto_hash_sha512_bytes()),s=_.address;if(a.push(s),0==(0|t._crypto_hash_sha512_final(e,s))){var n=(t._free(e),p(_,r));return v(a),n}g(a,"invalid usage")}function $e(e){var r=[];i(e);var a=new l(208).address;if(0==(0|t._crypto_hash_sha512_init(a))){var _=a;return v(r),_}g(r,"invalid usage")}function er(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_hash_sha512_update(e,s,n))&&g(_,"invalid usage"),v(_)}function rr(e,r,a,s,n){var c=[];i(n),f(c,e,"subkey_len"),("number"!=typeof e||(0|e)!==e||e<0)&&b(c,"subkey_len must be an unsigned integer"),f(c,r,"subkey_id"),("number"!=typeof r||(0|r)!==r||r<0)&&b(c,"subkey_id must be an unsigned integer"),"string"!=typeof a&&b(c,"ctx must be a string"),a=_(a+"\0"),null!=h&&a.length-1!==h&&b(c,"invalid ctx length");var o=u(a),h=a.length-1;c.push(o),s=m(c,s,"key");var y,d=0|t._crypto_kdf_keybytes();s.length!==d&&b(c,"invalid key length"),y=u(s),c.push(y);var g=new l(0|e),E=g.address;c.push(E),t._crypto_kdf_derive_from_key(E,e,r,r>>>24>>>8,o,y);var x=p(g,n);return v(c),x}function tr(e){var r=[];i(e);var a=new l(0|t._crypto_kdf_keybytes()),_=a.address;r.push(_),t._crypto_kdf_keygen(_);var s=p(a,e);return v(r),s}function ar(e,r,a,_){var s=[];i(_),e=m(s,e,"clientPublicKey");var n,c=0|t._crypto_kx_publickeybytes();e.length!==c&&b(s,"invalid clientPublicKey length"),n=u(e),s.push(n),r=m(s,r,"clientSecretKey");var o,h=0|t._crypto_kx_secretkeybytes();r.length!==h&&b(s,"invalid clientSecretKey length"),o=u(r),s.push(o),a=m(s,a,"serverPublicKey");var y,d=0|t._crypto_kx_publickeybytes();a.length!==d&&b(s,"invalid serverPublicKey length"),y=u(a),s.push(y);var f=new l(0|t._crypto_kx_sessionkeybytes()),E=f.address;s.push(E);var x=new l(0|t._crypto_kx_sessionkeybytes()),k=x.address;if(s.push(k),0==(0|t._crypto_kx_client_session_keys(E,k,n,o,y))){var S=p({sharedRx:f,sharedTx:x},_);return v(s),S}g(s,"invalid usage")}function _r(e){var r=[];i(e);var a=new l(0|t._crypto_kx_publickeybytes()),_=a.address;r.push(_);var s=new l(0|t._crypto_kx_secretkeybytes()),n=s.address;if(r.push(n),0==(0|t._crypto_kx_keypair(_,n))){var c={publicKey:p(a,e),privateKey:p(s,e),keyType:"x25519"};return v(r),c}g(r,"internal error")}function sr(e,r){var a=[];i(r),e=m(a,e,"seed");var _,s=0|t._crypto_kx_seedbytes();e.length!==s&&b(a,"invalid seed length"),_=u(e),a.push(_);var n=new l(0|t._crypto_kx_publickeybytes()),c=n.address;a.push(c);var o=new l(0|t._crypto_kx_secretkeybytes()),h=o.address;if(a.push(h),0==(0|t._crypto_kx_seed_keypair(c,h,_))){var y={publicKey:p(n,r),privateKey:p(o,r),keyType:"x25519"};return v(a),y}g(a,"internal error")}function nr(e,r,a,_){var s=[];i(_),e=m(s,e,"serverPublicKey");var n,c=0|t._crypto_kx_publickeybytes();e.length!==c&&b(s,"invalid serverPublicKey length"),n=u(e),s.push(n),r=m(s,r,"serverSecretKey");var o,h=0|t._crypto_kx_secretkeybytes();r.length!==h&&b(s,"invalid serverSecretKey length"),o=u(r),s.push(o),a=m(s,a,"clientPublicKey");var y,d=0|t._crypto_kx_publickeybytes();a.length!==d&&b(s,"invalid clientPublicKey length"),y=u(a),s.push(y);var f=new l(0|t._crypto_kx_sessionkeybytes()),E=f.address;s.push(E);var x=new l(0|t._crypto_kx_sessionkeybytes()),k=x.address;if(s.push(k),0==(0|t._crypto_kx_server_session_keys(E,k,n,o,y))){var S=p({sharedRx:f,sharedTx:x},_);return v(s),S}g(s,"invalid usage")}function cr(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_onetimeauth_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_onetimeauth_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_onetimeauth(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function or(e,r){var a=[];i(r),f(a,e,"state_address");var _=new l(0|t._crypto_onetimeauth_bytes()),s=_.address;if(a.push(s),0==(0|t._crypto_onetimeauth_final(e,s))){var n=(t._free(e),p(_,r));return v(a),n}g(a,"invalid usage")}function hr(e,r){var a=[];i(r);var _=null;null!=e&&(_=u(e=m(a,e,"key")),e.length,a.push(_));var s=new l(144).address;if(0==(0|t._crypto_onetimeauth_init(s,_))){var n=s;return v(a),n}g(a,"invalid usage")}function pr(e){var r=[];i(e);var a=new l(0|t._crypto_onetimeauth_keybytes()),_=a.address;r.push(_),t._crypto_onetimeauth_keygen(_);var s=p(a,e);return v(r),s}function yr(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_onetimeauth_update(e,s,n))&&g(_,"invalid usage"),v(_)}function ir(e,r,a){var _=[];e=m(_,e,"hash");var s,n=0|t._crypto_onetimeauth_bytes();e.length!==n&&b(_,"invalid hash length"),s=u(e),_.push(s);var c=u(r=m(_,r,"message")),o=r.length;_.push(c),a=m(_,a,"key");var h,p=0|t._crypto_onetimeauth_keybytes();a.length!==p&&b(_,"invalid key length"),h=u(a),_.push(h);var y=0==(0|t._crypto_onetimeauth_verify(s,c,o,0,h));return v(_),y}function lr(e,r,a,_,s,n,c){var o=[];i(c),f(o,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&b(o,"keyLength must be an unsigned integer");var h=u(r=m(o,r,"password")),y=r.length;o.push(h),a=m(o,a,"salt");var d,E=0|t._crypto_pwhash_saltbytes();a.length!==E&&b(o,"invalid salt length"),d=u(a),o.push(d),f(o,_,"opsLimit"),("number"!=typeof _||(0|_)!==_||_<0)&&b(o,"opsLimit must be an unsigned integer"),f(o,s,"memLimit"),("number"!=typeof s||(0|s)!==s||s<0)&&b(o,"memLimit must be an unsigned integer"),f(o,n,"algorithm"),("number"!=typeof n||(0|n)!==n||n<0)&&b(o,"algorithm must be an unsigned integer");var x=new l(0|e),k=x.address;if(o.push(k),0==(0|t._crypto_pwhash(k,e,0,h,y,0,d,_,0,s,n))){var S=p(x,c);return v(o),S}g(o,"invalid usage")}function ur(e,r,a,_,s,n){var c=[];i(n),f(c,e,"keyLength"),("number"!=typeof e||(0|e)!==e||e<0)&&b(c,"keyLength must be an unsigned integer");var o=u(r=m(c,r,"password")),h=r.length;c.push(o),a=m(c,a,"salt");var y,d=0|t._crypto_pwhash_scryptsalsa208sha256_saltbytes();a.length!==d&&b(c,"invalid salt length"),y=u(a),c.push(y),f(c,_,"opsLimit"),("number"!=typeof _||(0|_)!==_||_<0)&&b(c,"opsLimit must be an unsigned integer"),f(c,s,"memLimit"),("number"!=typeof s||(0|s)!==s||s<0)&&b(c,"memLimit must be an unsigned integer");var E=new l(0|e),x=E.address;if(c.push(x),0==(0|t._crypto_pwhash_scryptsalsa208sha256(x,e,0,o,h,0,y,_,0,s))){var k=p(E,n);return v(c),k}g(c,"invalid usage")}function dr(e,r,a,_,s,n,c){var o=[];i(c);var h=u(e=m(o,e,"password")),y=e.length;o.push(h);var d=u(r=m(o,r,"salt")),E=r.length;o.push(d),f(o,a,"opsLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(o,"opsLimit must be an unsigned integer"),f(o,_,"r"),("number"!=typeof _||(0|_)!==_||_<0)&&b(o,"r must be an unsigned integer"),f(o,s,"p"),("number"!=typeof s||(0|s)!==s||s<0)&&b(o,"p must be an unsigned integer"),f(o,n,"keyLength"),("number"!=typeof n||(0|n)!==n||n<0)&&b(o,"keyLength must be an unsigned integer");var x=new l(0|n),k=x.address;if(o.push(k),0==(0|t._crypto_pwhash_scryptsalsa208sha256_ll(h,y,d,E,a,0,_,s,k,n))){var S=p(x,c);return v(o),S}g(o,"invalid usage")}function vr(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"password")),c=e.length;s.push(n),f(s,r,"opsLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&b(s,"opsLimit must be an unsigned integer"),f(s,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(s,"memLimit must be an unsigned integer");var o=new l(0|t._crypto_pwhash_scryptsalsa208sha256_strbytes()).address;if(s.push(o),0==(0|t._crypto_pwhash_scryptsalsa208sha256_str(o,n,c,0,r,0,a))){var h=t.UTF8ToString(o);return v(s),h}g(s,"invalid usage")}function gr(e,r,a){var s=[];i(a),"string"!=typeof e&&b(s,"hashed_password must be a string"),e=_(e+"\0"),null!=c&&e.length-1!==c&&b(s,"invalid hashed_password length");var n=u(e),c=e.length-1;s.push(n);var o=u(r=m(s,r,"password")),h=r.length;s.push(o);var p=0==(0|t._crypto_pwhash_scryptsalsa208sha256_str_verify(n,o,h,0));return v(s),p}function br(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"password")),c=e.length;s.push(n),f(s,r,"opsLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&b(s,"opsLimit must be an unsigned integer"),f(s,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(s,"memLimit must be an unsigned integer");var o=new l(0|t._crypto_pwhash_strbytes()).address;if(s.push(o),0==(0|t._crypto_pwhash_str(o,n,c,0,r,0,a))){var h=t.UTF8ToString(o);return v(s),h}g(s,"invalid usage")}function fr(e,r,a,s){var n=[];i(s),"string"!=typeof e&&b(n,"hashed_password must be a string"),e=_(e+"\0"),null!=o&&e.length-1!==o&&b(n,"invalid hashed_password length");var c=u(e),o=e.length-1;n.push(c),f(n,r,"opsLimit"),("number"!=typeof r||(0|r)!==r||r<0)&&b(n,"opsLimit must be an unsigned integer"),f(n,a,"memLimit"),("number"!=typeof a||(0|a)!==a||a<0)&&b(n,"memLimit must be an unsigned integer");var h=0!=(0|t._crypto_pwhash_str_needs_rehash(c,r,0,a));return v(n),h}function mr(e,r,a){var s=[];i(a),"string"!=typeof e&&b(s,"hashed_password must be a string"),e=_(e+"\0"),null!=c&&e.length-1!==c&&b(s,"invalid hashed_password length");var n=u(e),c=e.length-1;s.push(n);var o=u(r=m(s,r,"password")),h=r.length;s.push(o);var p=0==(0|t._crypto_pwhash_str_verify(n,o,h,0));return v(s),p}function Er(e,r,a){var _=[];i(a),e=m(_,e,"privateKey");var s,n=0|t._crypto_scalarmult_scalarbytes();e.length!==n&&b(_,"invalid privateKey length"),s=u(e),_.push(s),r=m(_,r,"publicKey");var c,o=0|t._crypto_scalarmult_bytes();r.length!==o&&b(_,"invalid publicKey length"),c=u(r),_.push(c);var h=new l(0|t._crypto_scalarmult_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_scalarmult(y,s,c))){var d=p(h,a);return v(_),d}g(_,"weak public key")}function xr(e,r){var a=[];i(r),e=m(a,e,"privateKey");var _,s=0|t._crypto_scalarmult_scalarbytes();e.length!==s&&b(a,"invalid privateKey length"),_=u(e),a.push(_);var n=new l(0|t._crypto_scalarmult_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_scalarmult_base(c,_))){var o=p(n,r);return v(a),o}g(a,"unknown error")}function kr(e,r,a){var _=[];i(a),e=m(_,e,"n");var s,n=0|t._crypto_scalarmult_ed25519_scalarbytes();e.length!==n&&b(_,"invalid n length"),s=u(e),_.push(s),r=m(_,r,"p");var c,o=0|t._crypto_scalarmult_ed25519_bytes();r.length!==o&&b(_,"invalid p length"),c=u(r),_.push(c);var h=new l(0|t._crypto_scalarmult_ed25519_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_scalarmult_ed25519(y,s,c))){var d=p(h,a);return v(_),d}g(_,"invalid point or scalar is 0")}function Sr(e,r){var a=[];i(r),e=m(a,e,"scalar");var _,s=0|t._crypto_scalarmult_ed25519_scalarbytes();e.length!==s&&b(a,"invalid scalar length"),_=u(e),a.push(_);var n=new l(0|t._crypto_scalarmult_ed25519_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_scalarmult_ed25519_base(c,_))){var o=p(n,r);return v(a),o}g(a,"scalar is 0")}function Tr(e,r){var a=[];i(r),e=m(a,e,"scalar");var _,s=0|t._crypto_scalarmult_ed25519_scalarbytes();e.length!==s&&b(a,"invalid scalar length"),_=u(e),a.push(_);var n=new l(0|t._crypto_scalarmult_ed25519_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_scalarmult_ed25519_base_noclamp(c,_))){var o=p(n,r);return v(a),o}g(a,"scalar is 0")}function wr(e,r,a){var _=[];i(a),e=m(_,e,"n");var s,n=0|t._crypto_scalarmult_ed25519_scalarbytes();e.length!==n&&b(_,"invalid n length"),s=u(e),_.push(s),r=m(_,r,"p");var c,o=0|t._crypto_scalarmult_ed25519_bytes();r.length!==o&&b(_,"invalid p length"),c=u(r),_.push(c);var h=new l(0|t._crypto_scalarmult_ed25519_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_scalarmult_ed25519_noclamp(y,s,c))){var d=p(h,a);return v(_),d}g(_,"invalid point or scalar is 0")}function Yr(e,r,a){var _=[];i(a),e=m(_,e,"scalar");var s,n=0|t._crypto_scalarmult_ristretto255_scalarbytes();e.length!==n&&b(_,"invalid scalar length"),s=u(e),_.push(s),r=m(_,r,"element");var c,o=0|t._crypto_scalarmult_ristretto255_bytes();r.length!==o&&b(_,"invalid element length"),c=u(r),_.push(c);var h=new l(0|t._crypto_scalarmult_ristretto255_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_scalarmult_ristretto255(y,s,c))){var d=p(h,a);return v(_),d}g(_,"result is identity element")}function Br(e,r){var a=[];i(r),e=m(a,e,"scalar");var _,s=0|t._crypto_core_ristretto255_scalarbytes();e.length!==s&&b(a,"invalid scalar length"),_=u(e),a.push(_);var n=new l(0|t._crypto_core_ristretto255_bytes()),c=n.address;if(a.push(c),0==(0|t._crypto_scalarmult_ristretto255_base(c,_))){var o=p(n,r);return v(a),o}g(a,"scalar is 0")}function Ar(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_secretbox_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"key");var y,d=0|t._crypto_secretbox_keybytes();a.length!==d&&b(s,"invalid key length"),y=u(a),s.push(y);var f=new l(0|c),E=f.address;s.push(E);var x=new l(0|t._crypto_secretbox_macbytes()),k=x.address;if(s.push(k),0==(0|t._crypto_secretbox_detached(E,k,n,c,0,o,y))){var S=p({mac:x,cipher:f},_);return v(s),S}g(s,"invalid usage")}function Kr(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_secretbox_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"key");var y,d=0|t._crypto_secretbox_keybytes();a.length!==d&&b(s,"invalid key length"),y=u(a),s.push(y);var f=new l(c+t._crypto_secretbox_macbytes()|0),E=f.address;if(s.push(E),0==(0|t._crypto_secretbox_easy(E,n,c,0,o,y))){var x=p(f,_);return v(s),x}g(s,"invalid usage")}function Mr(e){var r=[];i(e);var a=new l(0|t._crypto_secretbox_keybytes()),_=a.address;r.push(_),t._crypto_secretbox_keygen(_);var s=p(a,e);return v(r),s}function Ir(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"ciphertext")),o=e.length;n.push(c),r=m(n,r,"mac");var h,y=0|t._crypto_secretbox_macbytes();r.length!==y&&b(n,"invalid mac length"),h=u(r),n.push(h),a=m(n,a,"nonce");var d,f=0|t._crypto_secretbox_noncebytes();a.length!==f&&b(n,"invalid nonce length"),d=u(a),n.push(d),_=m(n,_,"key");var E,x=0|t._crypto_secretbox_keybytes();_.length!==x&&b(n,"invalid key length"),E=u(_),n.push(E);var k=new l(0|o),S=k.address;if(n.push(S),0==(0|t._crypto_secretbox_open_detached(S,c,h,o,0,d,E))){var T=p(k,s);return v(n),T}g(n,"wrong secret key for the given ciphertext")}function Nr(e,r,a,_){var s=[];i(_),e=m(s,e,"ciphertext");var n,c=t._crypto_secretbox_macbytes(),o=e.length;o<c&&b(s,"ciphertext is too short"),n=u(e),s.push(n),r=m(s,r,"nonce");var h,y=0|t._crypto_secretbox_noncebytes();r.length!==y&&b(s,"invalid nonce length"),h=u(r),s.push(h),a=m(s,a,"key");var d,f=0|t._crypto_secretbox_keybytes();a.length!==f&&b(s,"invalid key length"),d=u(a),s.push(d);var E=new l(o-t._crypto_secretbox_macbytes()|0),x=E.address;if(s.push(x),0==(0|t._crypto_secretbox_open_easy(x,n,o,0,h,d))){var k=p(E,_);return v(s),k}g(s,"wrong secret key for the given ciphertext")}function Lr(e,r,a){var _=[];i(a),e=m(_,e,"header");var s,n=0|t._crypto_secretstream_xchacha20poly1305_headerbytes();e.length!==n&&b(_,"invalid header length"),s=u(e),_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_secretstream_xchacha20poly1305_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(52).address;if(0==(0|t._crypto_secretstream_xchacha20poly1305_init_pull(h,s,c))){var p=h;return v(_),p}g(_,"invalid usage")}function Ur(e,r){var a=[];i(r),e=m(a,e,"key");var _,s=0|t._crypto_secretstream_xchacha20poly1305_keybytes();e.length!==s&&b(a,"invalid key length"),_=u(e),a.push(_);var n=new l(52).address,c=new l(0|t._crypto_secretstream_xchacha20poly1305_headerbytes()),o=c.address;if(a.push(o),0==(0|t._crypto_secretstream_xchacha20poly1305_init_push(n,o,_))){var h={state:n,header:p(c,r)};return v(a),h}g(a,"invalid usage")}function Or(e){var r=[];i(e);var a=new l(0|t._crypto_secretstream_xchacha20poly1305_keybytes()),_=a.address;r.push(_),t._crypto_secretstream_xchacha20poly1305_keygen(_);var s=p(a,e);return v(r),s}function Cr(e,r,a,_){var s=[];i(_),f(s,e,"state_address"),r=m(s,r,"cipher");var n,c=t._crypto_secretstream_xchacha20poly1305_abytes(),o=r.length;o<c&&b(s,"cipher is too short"),n=u(r),s.push(n);var h=null,y=0;null!=a&&(h=u(a=m(s,a,"ad")),y=a.length,s.push(h));var g=new l(o-t._crypto_secretstream_xchacha20poly1305_abytes()|0),E=g.address;s.push(E);var x,k=(x=d(1),s.push(x),(k=0===t._crypto_secretstream_xchacha20poly1305_pull(e,E,0,x,n,o,0,h,y)&&{tag:t.HEAPU8[x],message:g})&&{message:p(k.message,_),tag:k.tag});return v(s),k}function Rr(e,r,a,_,s){var n=[];i(s),f(n,e,"state_address");var c=u(r=m(n,r,"message_chunk")),o=r.length;n.push(c);var h=null,y=0;null!=a&&(h=u(a=m(n,a,"ad")),y=a.length,n.push(h)),f(n,_,"tag"),("number"!=typeof _||(0|_)!==_||_<0)&&b(n,"tag must be an unsigned integer");var d=new l(o+t._crypto_secretstream_xchacha20poly1305_abytes()|0),E=d.address;if(n.push(E),0==(0|t._crypto_secretstream_xchacha20poly1305_push(e,E,0,c,o,0,h,y,0,_))){var x=p(d,s);return v(n),x}g(n,"invalid usage")}function Pr(e,r){var a=[];return i(r),f(a,e,"state_address"),t._crypto_secretstream_xchacha20poly1305_rekey(e),v(a),!0}function Gr(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_shorthash_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_shorthash_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_shorthash(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function Xr(e){var r=[];i(e);var a=new l(0|t._crypto_shorthash_keybytes()),_=a.address;r.push(_),t._crypto_shorthash_keygen(_);var s=p(a,e);return v(r),s}function Dr(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"key");var c,o=0|t._crypto_shorthash_siphashx24_keybytes();r.length!==o&&b(_,"invalid key length"),c=u(r),_.push(c);var h=new l(0|t._crypto_shorthash_siphashx24_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_shorthash_siphashx24(y,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function Fr(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"privateKey");var c,o=0|t._crypto_sign_secretkeybytes();r.length!==o&&b(_,"invalid privateKey length"),c=u(r),_.push(c);var h=new l(e.length+t._crypto_sign_bytes()|0),y=h.address;if(_.push(y),0==(0|t._crypto_sign(y,null,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function Vr(e,r,a){var _=[];i(a);var s=u(e=m(_,e,"message")),n=e.length;_.push(s),r=m(_,r,"privateKey");var c,o=0|t._crypto_sign_secretkeybytes();r.length!==o&&b(_,"invalid privateKey length"),c=u(r),_.push(c);var h=new l(0|t._crypto_sign_bytes()),y=h.address;if(_.push(y),0==(0|t._crypto_sign_detached(y,null,s,n,0,c))){var d=p(h,a);return v(_),d}g(_,"invalid usage")}function Hr(e,r){var a=[];i(r),e=m(a,e,"edPk");var _,s=0|t._crypto_sign_publickeybytes();e.length!==s&&b(a,"invalid edPk length"),_=u(e),a.push(_);var n=new l(0|t._crypto_scalarmult_scalarbytes()),c=n.address;if(a.push(c),0==(0|t._crypto_sign_ed25519_pk_to_curve25519(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid key")}function qr(e,r){var a=[];i(r),e=m(a,e,"edSk");var _,s=0|t._crypto_sign_secretkeybytes();e.length!==s&&b(a,"invalid edSk length"),_=u(e),a.push(_);var n=new l(0|t._crypto_scalarmult_scalarbytes()),c=n.address;if(a.push(c),0==(0|t._crypto_sign_ed25519_sk_to_curve25519(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid key")}function jr(e,r){var a=[];i(r),e=m(a,e,"privateKey");var _,s=0|t._crypto_sign_secretkeybytes();e.length!==s&&b(a,"invalid privateKey length"),_=u(e),a.push(_);var n=new l(0|t._crypto_sign_publickeybytes()),c=n.address;if(a.push(c),0==(0|t._crypto_sign_ed25519_sk_to_pk(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid key")}function zr(e,r){var a=[];i(r),e=m(a,e,"privateKey");var _,s=0|t._crypto_sign_secretkeybytes();e.length!==s&&b(a,"invalid privateKey length"),_=u(e),a.push(_);var n=new l(0|t._crypto_sign_seedbytes()),c=n.address;if(a.push(c),0==(0|t._crypto_sign_ed25519_sk_to_seed(c,_))){var o=p(n,r);return v(a),o}g(a,"invalid key")}function Wr(e,r,a){var _=[];i(a),f(_,e,"state_address"),r=m(_,r,"privateKey");var s,n=0|t._crypto_sign_secretkeybytes();r.length!==n&&b(_,"invalid privateKey length"),s=u(r),_.push(s);var c=new l(0|t._crypto_sign_bytes()),o=c.address;if(_.push(o),0==(0|t._crypto_sign_final_create(e,o,null,s))){var h=(t._free(e),p(c,a));return v(_),h}g(_,"invalid usage")}function Jr(e,r,a,_){var s=[];i(_),f(s,e,"state_address"),r=m(s,r,"signature");var n,c=0|t._crypto_sign_bytes();r.length!==c&&b(s,"invalid signature length"),n=u(r),s.push(n),a=m(s,a,"publicKey");var o,h=0|t._crypto_sign_publickeybytes();a.length!==h&&b(s,"invalid publicKey length"),o=u(a),s.push(o);var p=0==(0|t._crypto_sign_final_verify(e,n,o));return v(s),p}function Qr(e){var r=[];i(e);var a=new l(208).address;if(0==(0|t._crypto_sign_init(a))){var _=a;return v(r),_}g(r,"internal error")}function Zr(e){var r=[];i(e);var a=new l(0|t._crypto_sign_publickeybytes()),_=a.address;r.push(_);var s=new l(0|t._crypto_sign_secretkeybytes()),n=s.address;if(r.push(n),0==(0|t._crypto_sign_keypair(_,n))){var c={publicKey:p(a,e),privateKey:p(s,e),keyType:"ed25519"};return v(r),c}g(r,"internal error")}function $r(e,r,a){var _=[];i(a),e=m(_,e,"signedMessage");var s,n=t._crypto_sign_bytes(),c=e.length;c<n&&b(_,"signedMessage is too short"),s=u(e),_.push(s),r=m(_,r,"publicKey");var o,h=0|t._crypto_sign_publickeybytes();r.length!==h&&b(_,"invalid publicKey length"),o=u(r),_.push(o);var y=new l(c-t._crypto_sign_bytes()|0),d=y.address;if(_.push(d),0==(0|t._crypto_sign_open(d,null,s,c,0,o))){var f=p(y,a);return v(_),f}g(_,"incorrect signature for the given public key")}function et(e,r){var a=[];i(r),e=m(a,e,"seed");var _,s=0|t._crypto_sign_seedbytes();e.length!==s&&b(a,"invalid seed length"),_=u(e),a.push(_);var n=new l(0|t._crypto_sign_publickeybytes()),c=n.address;a.push(c);var o=new l(0|t._crypto_sign_secretkeybytes()),h=o.address;if(a.push(h),0==(0|t._crypto_sign_seed_keypair(c,h,_))){var y={publicKey:p(n,r),privateKey:p(o,r),keyType:"ed25519"};return v(a),y}g(a,"invalid usage")}function rt(e,r,a){var _=[];i(a),f(_,e,"state_address");var s=u(r=m(_,r,"message_chunk")),n=r.length;_.push(s),0!=(0|t._crypto_sign_update(e,s,n,0))&&g(_,"invalid usage"),v(_)}function tt(e,r,a){var _=[];e=m(_,e,"signature");var s,n=0|t._crypto_sign_bytes();e.length!==n&&b(_,"invalid signature length"),s=u(e),_.push(s);var c=u(r=m(_,r,"message")),o=r.length;_.push(c),a=m(_,a,"publicKey");var h,p=0|t._crypto_sign_publickeybytes();a.length!==p&&b(_,"invalid publicKey length"),h=u(a),_.push(h);var y=0==(0|t._crypto_sign_verify_detached(s,c,o,0,h));return v(_),y}function at(e,r,a,_){var s=[];i(_),f(s,e,"outLength"),("number"!=typeof e||(0|e)!==e||e<0)&&b(s,"outLength must be an unsigned integer"),r=m(s,r,"key");var n,c=0|t._crypto_stream_chacha20_keybytes();r.length!==c&&b(s,"invalid key length"),n=u(r),s.push(n),a=m(s,a,"nonce");var o,h=0|t._crypto_stream_chacha20_noncebytes();a.length!==h&&b(s,"invalid nonce length"),o=u(a),s.push(o);var y=new l(0|e),d=y.address;s.push(d),t._crypto_stream_chacha20(d,e,0,o,n);var g=p(y,_);return v(s),g}function _t(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"input_message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_stream_chacha20_ietf_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"key");var y,d=0|t._crypto_stream_chacha20_ietf_keybytes();a.length!==d&&b(s,"invalid key length"),y=u(a),s.push(y);var f=new l(0|c),E=f.address;if(s.push(E),0===t._crypto_stream_chacha20_ietf_xor(E,n,c,0,o,y)){var x=p(f,_);return v(s),x}g(s,"invalid usage")}function st(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"input_message")),o=e.length;n.push(c),r=m(n,r,"nonce");var h,y=0|t._crypto_stream_chacha20_ietf_noncebytes();r.length!==y&&b(n,"invalid nonce length"),h=u(r),n.push(h),f(n,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&b(n,"nonce_increment must be an unsigned integer"),_=m(n,_,"key");var d,E=0|t._crypto_stream_chacha20_ietf_keybytes();_.length!==E&&b(n,"invalid key length"),d=u(_),n.push(d);var x=new l(0|o),k=x.address;if(n.push(k),0===t._crypto_stream_chacha20_ietf_xor_ic(k,c,o,0,h,a,d)){var S=p(x,s);return v(n),S}g(n,"invalid usage")}function nt(e){var r=[];i(e);var a=new l(0|t._crypto_stream_chacha20_keybytes()),_=a.address;r.push(_),t._crypto_stream_chacha20_keygen(_);var s=p(a,e);return v(r),s}function ct(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"input_message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_stream_chacha20_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"key");var y,d=0|t._crypto_stream_chacha20_keybytes();a.length!==d&&b(s,"invalid key length"),y=u(a),s.push(y);var f=new l(0|c),E=f.address;if(s.push(E),0===t._crypto_stream_chacha20_xor(E,n,c,0,o,y)){var x=p(f,_);return v(s),x}g(s,"invalid usage")}function ot(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"input_message")),o=e.length;n.push(c),r=m(n,r,"nonce");var h,y=0|t._crypto_stream_chacha20_noncebytes();r.length!==y&&b(n,"invalid nonce length"),h=u(r),n.push(h),f(n,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&b(n,"nonce_increment must be an unsigned integer"),_=m(n,_,"key");var d,E=0|t._crypto_stream_chacha20_keybytes();_.length!==E&&b(n,"invalid key length"),d=u(_),n.push(d);var x=new l(0|o),k=x.address;if(n.push(k),0===t._crypto_stream_chacha20_xor_ic(k,c,o,0,h,a,0,d)){var S=p(x,s);return v(n),S}g(n,"invalid usage")}function ht(e){var r=[];i(e);var a=new l(0|t._crypto_stream_keybytes()),_=a.address;r.push(_),t._crypto_stream_keygen(_);var s=p(a,e);return v(r),s}function pt(e){var r=[];i(e);var a=new l(0|t._crypto_stream_xchacha20_keybytes()),_=a.address;r.push(_),t._crypto_stream_xchacha20_keygen(_);var s=p(a,e);return v(r),s}function yt(e,r,a,_){var s=[];i(_);var n=u(e=m(s,e,"input_message")),c=e.length;s.push(n),r=m(s,r,"nonce");var o,h=0|t._crypto_stream_xchacha20_noncebytes();r.length!==h&&b(s,"invalid nonce length"),o=u(r),s.push(o),a=m(s,a,"key");var y,d=0|t._crypto_stream_xchacha20_keybytes();a.length!==d&&b(s,"invalid key length"),y=u(a),s.push(y);var f=new l(0|c),E=f.address;if(s.push(E),0===t._crypto_stream_xchacha20_xor(E,n,c,0,o,y)){var x=p(f,_);return v(s),x}g(s,"invalid usage")}function it(e,r,a,_,s){var n=[];i(s);var c=u(e=m(n,e,"input_message")),o=e.length;n.push(c),r=m(n,r,"nonce");var h,y=0|t._crypto_stream_xchacha20_noncebytes();r.length!==y&&b(n,"invalid nonce length"),h=u(r),n.push(h),f(n,a,"nonce_increment"),("number"!=typeof a||(0|a)!==a||a<0)&&b(n,"nonce_increment must be an unsigned integer"),_=m(n,_,"key");var d,E=0|t._crypto_stream_xchacha20_keybytes();_.length!==E&&b(n,"invalid key length"),d=u(_),n.push(d);var x=new l(0|o),k=x.address;if(n.push(k),0===t._crypto_stream_xchacha20_xor_ic(k,c,o,0,h,a,0,d)){var S=p(x,s);return v(n),S}g(n,"invalid usage")}function lt(e,r){var a=[];i(r),f(a,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&b(a,"length must be an unsigned integer");var _=new l(0|e),s=_.address;a.push(s),t._randombytes_buf(s,e);var n=p(_,r);return v(a),n}function ut(e,r,a){var _=[];i(a),f(_,e,"length"),("number"!=typeof e||(0|e)!==e||e<0)&&b(_,"length must be an unsigned integer"),r=m(_,r,"seed");var s,n=0|t._randombytes_seedbytes();r.length!==n&&b(_,"invalid seed length"),s=u(r),_.push(s);var c=new l(0|e),o=c.address;_.push(o),t._randombytes_buf_deterministic(o,e,s);var h=p(c,a);return v(_),h}function dt(e){i(e),t._randombytes_close()}function vt(e){i(e);var r=t._randombytes_random()>>>0;return v([]),r}function gt(e,r){var a=[];i(r);for(var _=t._malloc(24),s=0;s<6;s++)t.setValue(_+4*s,t.Runtime.addFunction(e[["implementation_name","random","stir","uniform","buf","close"][s]]),"i32");0!=(0|t._randombytes_set_implementation(_))&&g(a,"unsupported implementation"),v(a)}function bt(e){i(e),t._randombytes_stir()}function ft(e,r){var a=[];i(r),f(a,e,"upper_bound"),("number"!=typeof e||(0|e)!==e||e<0)&&b(a,"upper_bound must be an unsigned integer");var _=t._randombytes_uniform(e)>>>0;return v(a),_}function mt(){var e=t._sodium_version_string(),r=t.UTF8ToString(e);return v([]),r}return l.prototype.to_Uint8Array=function(){var e=new Uint8Array(this.length);return e.set(t.HEAPU8.subarray(this.address,this.address+this.length)),e},e.add=function(e,r){if(!(e instanceof Uint8Array&&r instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can added");var t=e.length,a=0,_=0;if(r.length!=e.length)throw new TypeError("Arguments must have the same length");for(_=0;_<t;_++)a>>=8,a+=e[_]+r[_],e[_]=255&a},e.base64_variants=c,e.compare=function(e,r){if(!(e instanceof Uint8Array&&r instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==r.length)throw new TypeError("Only instances of identical length can be compared");for(var t=0,a=1,_=e.length;_-- >0;)t|=r[_]-e[_]>>8&a,a&=(r[_]^e[_])-1>>8;return t+t+a-1},e.from_base64=function(e,r){r=o(r);var a,_=[],s=new l(3*(e=m(_,e,"input")).length/4),n=u(e),c=d(4),h=d(4);return _.push(n),_.push(s.address),_.push(s.result_bin_len_p),_.push(s.b64_end_p),0!==t._sodium_base642bin(s.address,s.length,n,e.length,0,c,h,r)&&g(_,"invalid input"),t.getValue(h,"i32")-n!==e.length&&g(_,"incomplete input"),s.length=t.getValue(c,"i32"),a=s.to_Uint8Array(),v(_),a},e.from_hex=function(e){var r,a=[],_=new l((e=m(a,e,"input")).length/2),s=u(e),n=d(4);return a.push(s),a.push(_.address),a.push(_.hex_end_p),0!==t._sodium_hex2bin(_.address,_.length,s,e.length,0,0,n)&&g(a,"invalid input"),t.getValue(n,"i32")-s!==e.length&&g(a,"incomplete input"),r=_.to_Uint8Array(),v(a),r},e.from_string=_,e.increment=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be incremented");for(var r=256,t=0,a=e.length;t<a;t++)r>>=8,r+=e[t],e[t]=255&r},e.is_zero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be checked");for(var r=0,t=0,a=e.length;t<a;t++)r|=e[t];return 0===r},e.libsodium=r,e.memcmp=function(e,r){if(!(e instanceof Uint8Array&&r instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be compared");if(e.length!==r.length)throw new TypeError("Only instances of identical length can be compared");for(var t=0,a=0,_=e.length;a<_;a++)t|=e[a]^r[a];return 0===t},e.memzero=function(e){if(!(e instanceof Uint8Array))throw new TypeError("Only Uint8Array instances can be wiped");for(var r=0,t=e.length;r<t;r++)e[r]=0},e.output_formats=function(){return["uint8array","text","hex","base64"]},e.pad=function(e,r){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((r|=0)<=0)throw new Error("block size must be > 0");var a,_=[],s=d(4),n=1,c=0,o=0|e.length,h=new l(o+r);_.push(s),_.push(h.address);for(var p=h.address,y=h.address+o+r;p<y;p++)t.HEAPU8[p]=e[c],c+=n=1&~((65535&((o-=n)>>>48|o>>>32|o>>>16|o))-1>>16);return 0!==t._sodium_pad(s,h.address,e.length,r,h.length)&&g(_,"internal error"),h.length=t.getValue(s,"i32"),a=h.to_Uint8Array(),v(_),a},e.unpad=function(e,r){if(!(e instanceof Uint8Array))throw new TypeError("buffer must be a Uint8Array");if((r|=0)<=0)throw new Error("block size must be > 0");var a=[],_=u(e),s=d(4);return a.push(_),a.push(s),0!==t._sodium_unpad(s,_,e.length,r)&&g(a,"unsupported/invalid padding"),e=(e=new Uint8Array(e)).subarray(0,t.getValue(s,"i32")),v(a),e},e.ready=a,e.symbols=function(){return Object.keys(e).sort()},e.to_base64=h,e.to_hex=n,e.to_string=s,e}var t="object"==typeof e.sodium&&"function"==typeof e.sodium.onload?e.sodium.onload:null; true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports,__webpack_require__(/*! libsodium-sumo */ "./node_modules/libsodium-sumo/dist/modules-sumo/libsodium-sumo.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (r),
4661
4644
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
4662
4645
  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
4663
4646
  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):0,t&&e.sodium.ready.then((function(){t(e.sodium)}))}(this);
@@ -4674,15 +4657,15 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
4674
4657
  "use strict";
4675
4658
  __webpack_require__.r(__webpack_exports__);
4676
4659
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
4660
+ /* harmony export */ "NIL": () => (/* reexport safe */ _nil_js__WEBPACK_IMPORTED_MODULE_4__["default"]),
4661
+ /* harmony export */ "parse": () => (/* reexport safe */ _parse_js__WEBPACK_IMPORTED_MODULE_8__["default"]),
4662
+ /* harmony export */ "stringify": () => (/* reexport safe */ _stringify_js__WEBPACK_IMPORTED_MODULE_7__["default"]),
4677
4663
  /* harmony export */ "v1": () => (/* reexport safe */ _v1_js__WEBPACK_IMPORTED_MODULE_0__["default"]),
4678
4664
  /* harmony export */ "v3": () => (/* reexport safe */ _v3_js__WEBPACK_IMPORTED_MODULE_1__["default"]),
4679
4665
  /* harmony export */ "v4": () => (/* reexport safe */ _v4_js__WEBPACK_IMPORTED_MODULE_2__["default"]),
4680
4666
  /* harmony export */ "v5": () => (/* reexport safe */ _v5_js__WEBPACK_IMPORTED_MODULE_3__["default"]),
4681
- /* harmony export */ "NIL": () => (/* reexport safe */ _nil_js__WEBPACK_IMPORTED_MODULE_4__["default"]),
4682
- /* harmony export */ "version": () => (/* reexport safe */ _version_js__WEBPACK_IMPORTED_MODULE_5__["default"]),
4683
4667
  /* harmony export */ "validate": () => (/* reexport safe */ _validate_js__WEBPACK_IMPORTED_MODULE_6__["default"]),
4684
- /* harmony export */ "stringify": () => (/* reexport safe */ _stringify_js__WEBPACK_IMPORTED_MODULE_7__["default"]),
4685
- /* harmony export */ "parse": () => (/* reexport safe */ _parse_js__WEBPACK_IMPORTED_MODULE_8__["default"])
4668
+ /* harmony export */ "version": () => (/* reexport safe */ _version_js__WEBPACK_IMPORTED_MODULE_5__["default"])
4686
4669
  /* harmony export */ });
4687
4670
  /* harmony import */ var _v1_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./v1.js */ "./node_modules/uuid/dist/esm-browser/v1.js");
4688
4671
  /* harmony import */ var _v3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./v3.js */ "./node_modules/uuid/dist/esm-browser/v3.js");