@casual-simulation/crypto 3.4.1-alpha.14316240392 → 3.5.0-alpha.15117651144

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.
package/CryptoImpl.js CHANGED
@@ -1,2 +1,19 @@
1
+ /* CasualOS is a set of web-based tools designed to facilitate the creation of real-time, multi-user, context-aware interactive experiences.
2
+ *
3
+ * Copyright (c) 2019-2025 Casual Simulation, Inc.
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU Affero General Public License as
7
+ * published by the Free Software Foundation, either version 3 of the
8
+ * License, or (at your option) any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License
16
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
+ */
1
18
  export {};
2
19
  //# sourceMappingURL=CryptoImpl.js.map
package/CryptoImpl.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"CryptoImpl.js","sourceRoot":"","sources":["CryptoImpl.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"CryptoImpl.js","sourceRoot":"","sources":["CryptoImpl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
package/HashHelpers.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  /**
3
2
  * Calculates the SHA-256 hash of the given object.
4
3
  * @param obj The object to calculate the hash of.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casual-simulation/crypto",
3
- "version": "3.4.1-alpha.14316240392",
3
+ "version": "3.5.0-alpha.15117651144",
4
4
  "description": "Crypto helpers used by AUX",
5
5
  "keywords": [
6
6
  "cryptography",
@@ -40,12 +40,12 @@
40
40
  "access": "public"
41
41
  },
42
42
  "dependencies": {
43
- "@casual-simulation/fast-json-stable-stringify": "^3.4.1-alpha.14316240392",
43
+ "@casual-simulation/fast-json-stable-stringify": "^3.5.0-alpha.15117651144",
44
44
  "@types/scrypt-async": "^1.3.1",
45
45
  "base64-js": "^1.5.1",
46
46
  "hash.js": "1.1.7",
47
47
  "scrypt-js": "3.0.1",
48
48
  "tweetnacl": "1.0.3"
49
49
  },
50
- "gitHead": "7ae19d5c713490d6b6887939fa480e16be7111ae"
50
+ "gitHead": "3e2803698d7c87343fb3b3c29a2f27f4b9efe942"
51
51
  }
@@ -1,12 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  export class TestCryptoImpl {
11
2
  constructor(algorithm) {
12
3
  this.valid = false;
@@ -16,20 +7,14 @@ export class TestCryptoImpl {
16
7
  supported() {
17
8
  return true;
18
9
  }
19
- sign(key, data) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- return this.signature || data.slice(0, 32);
22
- });
10
+ async sign(key, data) {
11
+ return this.signature || data.slice(0, 32);
23
12
  }
24
- verify(key, signature, data) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- return this.valid;
27
- });
13
+ async verify(key, signature, data) {
14
+ return this.valid;
28
15
  }
29
- verifyBatch(key, signatures, datas) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- return signatures.map((s) => this.valid);
32
- });
16
+ async verifyBatch(key, signatures, datas) {
17
+ return signatures.map((s) => this.valid);
33
18
  }
34
19
  exportKey(key) {
35
20
  return Promise.resolve(key.type);
@@ -40,13 +25,11 @@ export class TestCryptoImpl {
40
25
  importPrivateKey(key) {
41
26
  return Promise.resolve(new TestCryptoKey(key));
42
27
  }
43
- generateKeyPair() {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- return [
46
- new TestCryptoKey('public'),
47
- new TestCryptoKey('private'),
48
- ];
49
- });
28
+ async generateKeyPair() {
29
+ return [
30
+ new TestCryptoKey('public'),
31
+ new TestCryptoKey('private'),
32
+ ];
50
33
  }
51
34
  }
52
35
  export class TestCryptoKey {
@@ -1 +1 @@
1
- {"version":3,"file":"TestCryptoImpl.js","sourceRoot":"","sources":["TestCryptoImpl.ts"],"names":[],"mappings":";;;;;;;;;AAyBA,MAAM,OAAO,cAAc;IAKvB,YAAY,SAAiC;QAJ7C,UAAK,GAAY,KAAK,CAAC;QACvB,cAAS,GAAgB,IAAI,CAAC;QAI1B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,CAAC;IAED,SAAS;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;IAEK,IAAI,CAAC,GAAqB,EAAE,IAAiB;;YAC/C,OAAO,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/C,CAAC;KAAA;IAEK,MAAM,CACR,GAAoB,EACpB,SAAsB,EACtB,IAAiB;;YAEjB,OAAO,IAAI,CAAC,KAAK,CAAC;QACtB,CAAC;KAAA;IAEK,WAAW,CACb,GAAoB,EACpB,UAAyB,EACzB,KAAoB;;YAEpB,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;KAAA;IAED,SAAS,CAAC,GAAqB;QAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,eAAe,CAAC,GAAW;QACvB,OAAO,OAAO,CAAC,OA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