@dxos/crypto 2.33.7-dev.c2ba88fb → 2.33.8-dev.8609bc45

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.
@@ -45,7 +45,7 @@ const DEFAULT_WORDLIST = [
45
45
  /**
46
46
  * humanhash: Human-readable representations of digests.
47
47
  */
48
- // TODO(wittjosiah): Is this needed still?
48
+ // TODO(wittjosiah): Move to debug?
49
49
  class HumanHasher {
50
50
  /**
51
51
  * Transforms hex digests to human-readable strings.
@@ -1 +1 @@
1
- {"version":3,"file":"human-hash.js","sourceRoot":"","sources":["../../src/human-hash.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,kGAAkG;AAElG,MAAM,gBAAgB,GAAG;IACvB,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;IACzE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;IACzE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW;IACvE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ;IACpE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK;IACzE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;IACrE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU;IACxE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;IAClE,QAAQ,EAAE,OAAO,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AM,CAAC;QAC5B,IAAI,MAAM,GAAG,MAAM,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;SAC5D;QAED,qDAAqD;QACrD,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,IAAI,CAAC,CAAC;QAErC,wDAAwD;QACxD,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,IAAI,OAAO,EAAE;YAClD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;SAC5C;QAED,iDAAiD;QACjD,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;QAEpG,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;QAC3E,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAtED,kCAsEC"}
@@ -2,7 +2,5 @@ export * from './encrypt';
2
2
  export * from './hash';
3
3
  export * from './human-hash';
4
4
  export * from './keys';
5
- export * from './seedphrase';
6
5
  export * from './validator';
7
- export * from './public-key';
8
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
package/dist/src/index.js CHANGED
@@ -21,7 +21,5 @@ __exportStar(require("./encrypt"), exports);
21
21
  __exportStar(require("./hash"), exports);
22
22
  __exportStar(require("./human-hash"), exports);
23
23
  __exportStar(require("./keys"), exports);
24
- __exportStar(require("./seedphrase"), exports);
25
24
  __exportStar(require("./validator"), exports);
26
- __exportStar(require("./public-key"), exports);
27
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,4CAA0B;AAC1B,yCAAuB;AACvB,+CAA6B;AAC7B,yCAAuB;AACvB,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,4CAA0B;AAC1B,yCAAuB;AACvB,+CAA6B;AAC7B,yCAAuB;AACvB,8CAA4B"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
+ import { PublicKeyLike } from '@dxos/protocols';
2
3
  import { HumanHasher } from './human-hash';
3
- import { PublicKey, PublicKeyLike } from './public-key';
4
4
  export declare const hasher: HumanHasher;
5
5
  export declare const PUBLIC_KEY_LENGTH = 32;
6
6
  export declare const SECRET_KEY_LENGTH = 64;
@@ -21,8 +21,8 @@ export declare const keyToBuffer: (str: string) => Buffer;
21
21
  * @param {Buffer | Uint8Array} buffer - Key buffer.
22
22
  * @return {string} Hex string representation of key.
23
23
  */
24
- export declare const keyToString: (buffer: Buffer | Uint8Array | PublicKey) => string;
25
- export declare const humanize: (value: Buffer | Uint8Array | string) => string;
24
+ export declare const keyToString: (buffer: PublicKeyLike) => string;
25
+ export declare const humanize: (value: PublicKeyLike) => string;
26
26
  /**
27
27
  * Return random bytes of length.
28
28
  * @param [length=32]
@@ -1 +1 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/keys.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAExD,eAAO,MAAM,MAAM,aAAoB,CAAC;AAExC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,eAAO,MAAM,OAAO,kBAA2B,CAAC;AAOhD,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,KAAG,OAM7C,CAAC;AAEF,eAAO,MAAM,YAAY,QAAS,aAAa,KAAG,MAA6D,CAAC;AAEhH;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAS,MAAM,KAAG,MAMzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,WAAY,MAAM,GAAG,UAAU,GAAG,SAAS,KAAG,MASrE,CAAC;AAEF,eAAO,MAAM,QAAQ,UAAW,MAAM,GAAG,UAAU,GAAG,MAAM,KAAG,MAM9D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,uBAAkB,MAAoC,CAAC;AAE/E;;GAEG;AACH,eAAO,MAAM,QAAQ,QAAO,MAAsC,CAAC;AAEnE;;;;;GAKG;AAC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js CHANGED
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.verify = exports.sign = exports.createId = exports.randomBytes = exports.humanize = exports.keyToString = exports.keyToBuffer = exports.discoveryKey = exports.createKeyPair = exports.zeroKey = exports.SIGNATURE_LENGTH = exports.SECRET_KEY_LENGTH = exports.PUBLIC_KEY_LENGTH = exports.hasher = void 0;
10
10
  const assert_1 = __importDefault(require("assert"));
11
11
  const hypercore_crypto_1 = __importDefault(require("hypercore-crypto"));
12
+ const protocols_1 = require("@dxos/protocols");
12
13
  const human_hash_1 = require("./human-hash");
13
- const public_key_1 = require("./public-key");
14
14
  exports.hasher = new human_hash_1.HumanHasher();
15
- exports.PUBLIC_KEY_LENGTH = 32;
15
+ exports.PUBLIC_KEY_LENGTH = 32; // TODO(wittjosiah): Move to protocols with PublicKey?
16
16
  exports.SECRET_KEY_LENGTH = 64;
17
17
  exports.SIGNATURE_LENGTH = 64;
18
18
  const zeroKey = () => new Uint8Array(32);
@@ -25,7 +25,7 @@ const createKeyPair = (seed) => {
25
25
  return hypercore_crypto_1.default.keyPair();
26
26
  };
27
27
  exports.createKeyPair = createKeyPair;
28
- const discoveryKey = (key) => hypercore_crypto_1.default.discoveryKey(public_key_1.PublicKey.from(key).asBuffer());
28
+ const discoveryKey = (key) => hypercore_crypto_1.default.discoveryKey(protocols_1.PublicKey.from(key).asBuffer());
29
29
  exports.discoveryKey = discoveryKey;
30
30
  /**
31
31
  * @param {string} str - Hex string representation of key.
@@ -43,7 +43,7 @@ exports.keyToBuffer = keyToBuffer;
43
43
  * @return {string} Hex string representation of key.
44
44
  */
45
45
  const keyToString = (buffer) => {
46
- if (buffer instanceof public_key_1.PublicKey) {
46
+ if (buffer instanceof protocols_1.PublicKey) {
47
47
  buffer = buffer.asBuffer();
48
48
  }
49
49
  else if (buffer instanceof Uint8Array) {
@@ -54,7 +54,7 @@ const keyToString = (buffer) => {
54
54
  };
55
55
  exports.keyToString = keyToString;
56
56
  const humanize = (value) => {
57
- if (value instanceof Buffer || value instanceof Uint8Array) {
57
+ if (value instanceof protocols_1.PublicKey || value instanceof Buffer || value instanceof Uint8Array) {
58
58
  value = (0, exports.keyToString)(value);
59
59
  }
60
60
  return exports.hasher.humanize(value);
@@ -1 +1 @@
1
- {"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/keys.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAC5B,wEAAsC;AAEtC,6CAA2C;AAC3C,6CAAwD;AAE3C,QAAA,MAAM,GAAG,IAAI,wBAAW,EAAE,CAAC;AAE3B,QAAA,iBAAiB,GAAG,EAAE,CAAC;AACvB,QAAA,iBAAiB,GAAG,EAAE,CAAC;AACvB,QAAA,gBAAgB,GAAG,EAAE,CAAC;AAE5B,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAAnC,QAAA,OAAO,WAA4B;AAYzC,MAAM,aAAa,GAAG,CAAC,IAAa,EAAW,EAAE;IACtD,IAAI,IAAI,EAAE;QACR,IAAA,gBAAM,EAAC,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,8CAA8C,CAAC,CAAC;QAC1E,OAAO,0BAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;KAC1C;IACD,OAAO,0BAAM,CAAC,OAAO,EAAE,CAAC;AAC1B,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB;AAEK,MAAM,YAAY,GAAG,CAAC,GAAkB,EAAU,EAAE,CAAC,0BAAM,CAAC,YAAY,CAAC,sBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAAnG,QAAA,YAAY,gBAAuF;AAEhH;;;GAGG;AACI,MAAM,WAAW,GAAG,CAAC,GAAW,EAAU,EAAE;IACjD,IAAA,gBAAM,EAAC,OAAO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E,OAAO,0BAAM,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACzC,CAAC,CAAC;AALW,QAAA,IAAI,QAKf;AAEF;;;;;;GAMG;AACI,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,SAAiB,EAAE,SAAiB,EAAW,EAAE;IACvF,IAAA,gBAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACjC,IAAA,gBAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,wBAAgB,CAAC,CAAC;IAC5E,IAAA,gBAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,yBAAiB,CAAC,CAAC;IAE7E,OAAO,0BAAM,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AACtD,CAAC,CAAC;AANW,QAAA,MAAM,UAMjB"}
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es5.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2016.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.esnext.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../common/temp/node_modules/.pnpm/@types+crypto-js@4.0.2/node_modules/@types/crypto-js/index.d.ts","../src/encrypt.ts","../src/encrypt.test.ts","../src/hash.ts","../src/hash.test.ts","../src/human-hash.ts","../src/public-key.ts","../src/keys.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert/strict.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/async_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/buffer.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/child_process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/cluster.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/console.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/constants.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/crypto.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dgram.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/diagnostics_channel.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/domain.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http2.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/https.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/inspector.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/module.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/net.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/os.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/path.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/perf_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/punycode.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/querystring.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/readline.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/repl.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/consumers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/web.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/string_decoder.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tls.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/trace_events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tty.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/url.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/util.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/v8.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/vm.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/wasi.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/worker_threads.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/zlib.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.global.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/index.d.ts","../../../../common/temp/node_modules/.pnpm/bip39@3.0.4/node_modules/bip39/types/_wordlists.d.ts","../../../../common/temp/node_modules/.pnpm/bip39@3.0.4/node_modules/bip39/types/index.d.ts","../src/seedphrase.ts","../src/validator.ts","../src/index.ts","../src/keys.test.ts","../src/public-key.test.ts","../src/seedphrase.test.ts","../src/shims.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/cleanupSemantic.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/types.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/diffLines.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/printDiffs.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@26.6.2/node_modules/pretty-format/build/types.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@26.6.2/node_modules/pretty-format/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+jest@26.0.24/node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","3eb679a56cab01203a1ba7edeade937f6a2a4c718513b2cd930b579807fa9359","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"ff667ee99e5a28c3dc5063a3cfd4d3436699e3fb035d4451037da7f567da542a","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"6ea9ab679ea030cf46c16a711a316078e9e02619ebaf07a7fcd16964aba88f2d","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},{"version":"070fafc332546049324c5eb0559b40974f700aa78eee7a12d1486035baa39558","affectsGlobalScope":true},{"version":"eb5714694231b2e20c388bbb7dfa862780a458a07cd87b2737e6be1f6169a8ad","signature":"371f32dc57397d7fa8a5b8680e3fbb4415acab6ffe15a08d26ee856593ccf3f7"},{"version":"528215f3eec43ecbb2420cfde8d88672328129643a1586a13d86d5e80c415110","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"1127d47e6d5d89262545d064ee90a5ccef53a80f4d81eedb3221251198ec366f","signature":"4013fc0cdc2ba4c291ba160fd6204c796d0ca7dad35ea719ec9c4d00ec21305e"},{"version":"e747a4ae9c8bed522f9c9c7738775ac50455ab182f09f70498e5a7ab1260a8aa","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"d58ec2ba85d2a1d02ea772c29ed3db8131f2d3f8ade7091772bb54d7a826f8f5","signature":"ede1f891817b1a038aef58251be9a5c1981c9aac102d9ea1b483b6abed64437f"},{"version":"e1b491568740742b7c4c245509d70bd35bc35fc4e468a66eb6207cec1c3817c8","signature":"cc473a1fa10d7b45fda99dda9c31f81e1bbedf45c2979faa8b8c332d242afd73"},{"version":"dc967f470fdbfff3e07fd9dc33423d6b141d560a6073721867bb01614e1b85d1","signature":"bdfc667f9cbb7a6cb2e15934108679f59b7c9267621c52c5dc4be12672cd17ad"},"0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"aeeee3998c5a730f8689f04038d41cf4245c9edbf6ef29a698e45b36e399b8ed","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","e3b886bacdd1fbf1f72e654596c80a55c7bc1d10bdf464aaf52f45ecd243862f","c665d5c50c2573aefd98f0ffb12c5583e333ed94294ce6f144a4163a8c84f09b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"8a215750db3e2073511e07c9e293c8c40d6109e5c7368845e060bcc12adbae6f","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","945a841f9a591197154c85386bc5a1467d42d325104bb36db51bc566bbb240be","10c39ce1df102994b47d4bc0c71aa9a6aea76f4651a5ec51914431f50bc883a1",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","3fa48484c65913004d5abb5c0f917b61ea4684f32d05bb28c1ecfa5f05a9ed12","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"33eee034727baf564056b4ea719075c23d3b4767d0b5f9c6933b81f3d77774d2","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4",{"version":"dd9ea469d1bfaf589c6a196275d35cb1aa14014707c2c46d920c7b921e8f5bca","affectsGlobalScope":true},"badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1503a452a67127e5c2da794d1c7c44344d5038373aae16c9b03ac964db159edd","b50dc1eb21ae0cf50fdad3a52298af07a6c5aa681c55ecc68b45362294dc3972","2403a8e0780ec6f1e95f3a4f922eafdda29da975f0bffe7e35cad640b333247c",{"version":"7375a5e2ea098604b887eedbe26239902a66a8b81fc7ea298c6c90df5e00c4b6","signature":"1961ebfc123d0fbcd009f1c48a6eaf89176f5122a461b371038a55cab522bc97"},{"version":"7dcc90de23c417ea963789112cc023c68f2bcf6a648339dc6baaf40ca648c29d","signature":"29a6655bb4e637e54e67ea8213a53afce35c868c2a22a8ec24ee00db751005b6"},{"version":"3b326fc57d670a566069f16112543a537625a2a7addd2d31c6df95d8d0542609","signature":"55c9f9bd9448d84fdad96e557e81b26f8a3e82194d7a3f81eb39bb17ac76f3c2"},{"version":"cf0c4790c3404e84670821dfdf727fe1023ff2c9cbe1febf24f0b2a27509ccf8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"6c6bdd61b28ff2bde56023810bcd84333aa2dc458fddcd20b9262f6b3cf9d727","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"c67c641af9d44979f3e28f88e40f92290a964f8e9ef0ea8d66204c7c78032f4f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"bc6a5524c9b408e1e310ba838b5af3790cb9bdb0d60dd0d8f594ff670e770455","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","561eca7a381b96d6ccac6e4061e6d2ae53f5bc44203f3fd9f5b26864c32ae6e9","62ea38627e3ebab429f7616812a9394d327c2bc271003dfba985de9b4137369f","b4439890c168d646357928431100daac5cbdee1d345a34e6bf6eca9f3abe22bc","5d72971a459517c44c1379dab9ed248e87a61ba0a1e0f25c9d67e1e640cd9a09","02d734976af36f4273d930bea88b3e62adf6b078cf120c1c63d49aa8d8427c5c",{"version":"516a426e3960379f310107635b8f3a7e8c307c6c665080b128039d9299ec4087","affectsGlobalScope":true}],"options":{"composite":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":1,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":5},"fileIdsList":[[104],[104,125,127],[61,104],[64,104],[65,70,104],[66,76,77,84,93,103,104],[66,67,76,84,104],[68,104],[69,70,77,85,104],[70,93,100,104],[71,73,76,84,104],[72,104],[73,74,104],[75,76,104],[76,104],[76,77,78,93,103,104],[76,77,78,93,104],[79,84,93,103,104],[76,77,79,80,84,93,100,103,104],[79,81,93,100,103,104],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110],[76,82,104],[83,103,104],[73,76,84,93,104],[85,104],[86,104],[64,87,104],[88,102,104,108],[89,104],[90,104],[76,91,104],[91,92,104,106],[76,93,94,95,104],[93,95,104],[93,94,104],[96,104],[97,104],[76,98,99,104],[98,99,104],[70,84,100,104],[101,104],[84,102,104],[65,79,90,103,104],[70,104],[93,104,105],[104,106],[104,107],[65,70,76,78,87,93,103,104,106,108],[93,104,109],[104,111,112],[104,121,122],[104,121,122,123,124],[104,126],[54,104],[53,61,104],[56,104],[54,56,58,59,60,104,114,115],[60,104],[58,59,61,104,120],[59,60,104],[58,104,120],[60,104,113,114],[60,61,104,113],[60,104,120],[54,56,58,59,60,114,115],[58,59],[60]],"referencedMap":[[53,1],[128,2],[61,3],[62,3],[64,4],[65,5],[66,6],[67,7],[68,8],[69,9],[70,10],[71,11],[72,12],[73,13],[74,13],[75,14],[76,15],[77,16],[78,17],[63,1],[110,1],[79,18],[80,19],[81,20],[111,21],[82,22],[83,23],[84,24],[85,25],[86,26],[87,27],[88,28],[89,29],[90,30],[91,31],[92,32],[93,33],[95,34],[94,35],[96,36],[97,37],[98,38],[99,39],[100,40],[101,41],[102,42],[103,43],[104,44],[105,45],[106,46],[107,47],[108,48],[109,49],[112,1],[113,50],[121,1],[123,51],[125,52],[124,51],[122,1],[127,53],[126,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[32,1],[33,1],[34,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[8,1],[46,1],[43,1],[44,1],[45,1],[47,1],[9,1],[48,1],[49,1],[50,1],[51,1],[1,1],[10,1],[52,1],[55,54],[54,55],[57,56],[56,55],[58,1],[116,57],[117,58],[60,59],[118,60],[59,61],[119,62],[114,63],[120,1],[115,64]],"exportedModulesMap":[[53,1],[128,2],[61,3],[62,3],[64,4],[65,5],[66,6],[67,7],[68,8],[69,9],[70,10],[71,11],[72,12],[73,13],[74,13],[75,14],[76,15],[77,16],[78,17],[63,1],[110,1],[79,18],[80,19],[81,20],[111,21],[82,22],[83,23],[84,24],[85,25],[86,26],[87,27],[88,28],[89,29],[90,30],[91,31],[92,32],[93,33],[95,34],[94,35],[96,36],[97,37],[98,38],[99,39],[100,40],[101,41],[102,42],[103,43],[104,44],[105,45],[106,46],[107,47],[108,48],[109,49],[112,1],[113,50],[121,1],[123,51],[125,52],[124,51],[122,1],[127,53],[126,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[32,1],[33,1],[34,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[8,1],[46,1],[43,1],[44,1],[45,1],[47,1],[9,1],[48,1],[49,1],[50,1],[51,1],[1,1],[10,1],[52,1],[116,65],[60,66],[59,1],[114,67],[120,1]],"semanticDiagnosticsPerFile":[53,128,61,62,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,63,110,79,80,81,111,82,83,84,85,86,87,88,89,90,91,92,93,95,94,96,97,98,99,100,101,102,103,104,105,106,107,108,109,112,113,121,123,125,124,122,127,126,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,36,41,42,37,38,39,40,8,46,43,44,45,47,9,48,49,50,51,1,10,52,55,54,57,56,58,116,117,60,118,59,119,114,120,115]},"version":"4.7.4"}
1
+ {"program":{"fileNames":["../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es5.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2016.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.esnext.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../common/temp/node_modules/.pnpm/typescript@4.7.4/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../common/temp/node_modules/.pnpm/@types+crypto-js@4.0.2/node_modules/@types/crypto-js/index.d.ts","../src/encrypt.ts","../src/encrypt.test.ts","../src/hash.ts","../src/hash.test.ts","../src/human-hash.ts","../../protocols/dist/src/proto/gen/google/protobuf.d.ts","../../protocols/dist/src/proto/gen/dxos/credentials.d.ts","../../protocols/dist/src/proto/gen/dxos/halo/keys.d.ts","../../protocols/dist/src/proto/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/assert/strict.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/async_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/buffer.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/child_process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/cluster.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/console.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/constants.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/crypto.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dgram.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/diagnostics_channel.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/dns/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/domain.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/fs/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/http2.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/https.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/inspector.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/module.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/net.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/os.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/path.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/perf_hooks.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/process.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/punycode.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/querystring.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/readline.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/repl.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/consumers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/stream/web.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/string_decoder.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/timers/promises.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tls.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/trace_events.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/tty.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/url.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/util.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/v8.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/vm.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/wasi.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/worker_threads.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/zlib.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/globals.global.d.ts","../../../../common/temp/node_modules/.pnpm/@types+node@16.11.27/node_modules/@types/node/index.d.ts","../../protocols/dist/src/public-key.d.ts","../../protocols/dist/src/index.d.ts","../src/keys.ts","../src/validator.ts","../src/index.ts","../src/keys.test.ts","../src/shims.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/cleanupSemantic.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/types.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/diffLines.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/printDiffs.d.ts","../../../../common/temp/node_modules/.pnpm/jest-diff@26.6.2/node_modules/jest-diff/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@26.6.2/node_modules/pretty-format/build/types.d.ts","../../../../common/temp/node_modules/.pnpm/pretty-format@26.6.2/node_modules/pretty-format/build/index.d.ts","../../../../common/temp/node_modules/.pnpm/@types+jest@26.0.24/node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","3eb679a56cab01203a1ba7edeade937f6a2a4c718513b2cd930b579807fa9359","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"ff667ee99e5a28c3dc5063a3cfd4d3436699e3fb035d4451037da7f567da542a","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"6ea9ab679ea030cf46c16a711a316078e9e02619ebaf07a7fcd16964aba88f2d","affectsGlobalScope":true},{"version":"6bda95ea27a59a276e46043b7065b55bd4b316c25e70e29b572958fa77565d43","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},{"version":"070fafc332546049324c5eb0559b40974f700aa78eee7a12d1486035baa39558","affectsGlobalScope":true},{"version":"eb5714694231b2e20c388bbb7dfa862780a458a07cd87b2737e6be1f6169a8ad","signature":"371f32dc57397d7fa8a5b8680e3fbb4415acab6ffe15a08d26ee856593ccf3f7"},{"version":"528215f3eec43ecbb2420cfde8d88672328129643a1586a13d86d5e80c415110","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"1127d47e6d5d89262545d064ee90a5ccef53a80f4d81eedb3221251198ec366f","signature":"4013fc0cdc2ba4c291ba160fd6204c796d0ca7dad35ea719ec9c4d00ec21305e"},{"version":"e747a4ae9c8bed522f9c9c7738775ac50455ab182f09f70498e5a7ab1260a8aa","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"89489068d5fd52b2c9fb36801606a056f5e09d525ddf0f637e3df5f433da3168","signature":"ede1f891817b1a038aef58251be9a5c1981c9aac102d9ea1b483b6abed64437f"},"011267fade3e4c99b36a9d3d14734461309de6a989f5b27ac7ac98123083e31f","3134f52cda99065c8630aa4552c7509923f76af422bb5643b3bf49bfbbd0894c","7dab91e9b6f9cb074893138261f91345371bbf053099253bc47ccdc722388da3","58ada477113e6a47d967c034a83392adfcaad478688e6916a471919d8798ff53","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"aeeee3998c5a730f8689f04038d41cf4245c9edbf6ef29a698e45b36e399b8ed","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","e3b886bacdd1fbf1f72e654596c80a55c7bc1d10bdf464aaf52f45ecd243862f","c665d5c50c2573aefd98f0ffb12c5583e333ed94294ce6f144a4163a8c84f09b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"8a215750db3e2073511e07c9e293c8c40d6109e5c7368845e060bcc12adbae6f","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","945a841f9a591197154c85386bc5a1467d42d325104bb36db51bc566bbb240be","10c39ce1df102994b47d4bc0c71aa9a6aea76f4651a5ec51914431f50bc883a1",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","3fa48484c65913004d5abb5c0f917b61ea4684f32d05bb28c1ecfa5f05a9ed12","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"33eee034727baf564056b4ea719075c23d3b4767d0b5f9c6933b81f3d77774d2","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4",{"version":"dd9ea469d1bfaf589c6a196275d35cb1aa14014707c2c46d920c7b921e8f5bca","affectsGlobalScope":true},"badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1503a452a67127e5c2da794d1c7c44344d5038373aae16c9b03ac964db159edd","0c45729ee48934bd4c5f7d2db2c93c26855bd60ddb9ed2e6b50eea540d10874a","e8ba6acb214115658895eddc9eb583d7e3ce74619b50a26bafeeb0496e08cdfd",{"version":"10c5a1fa6da1364955513ce9f41f377c0aefa32e0e29ee1920ff90137cce32ce","signature":"886cf8080ccf1b88f6756ee7adb6135ae019846fa190fc0b5a438d639063a0c3"},{"version":"7dcc90de23c417ea963789112cc023c68f2bcf6a648339dc6baaf40ca648c29d","signature":"29a6655bb4e637e54e67ea8213a53afce35c868c2a22a8ec24ee00db751005b6"},{"version":"b86f00454127f4c98d9050e6f1f0370e7ed668da92bfe7b2f2aacb77d9db6524","signature":"5f0a6c57c7e3e50d414b9dd1502f7400b5427adb96e7de4e44adf1cbedb1e83c"},{"version":"cf0c4790c3404e84670821dfdf727fe1023ff2c9cbe1febf24f0b2a27509ccf8","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"bc6a5524c9b408e1e310ba838b5af3790cb9bdb0d60dd0d8f594ff670e770455","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","69da61a7b5093dac77fa3bec8be95dcf9a74c95a0e9161edb98bb24e30e439d2","561eca7a381b96d6ccac6e4061e6d2ae53f5bc44203f3fd9f5b26864c32ae6e9","62ea38627e3ebab429f7616812a9394d327c2bc271003dfba985de9b4137369f","b4439890c168d646357928431100daac5cbdee1d345a34e6bf6eca9f3abe22bc","5d72971a459517c44c1379dab9ed248e87a61ba0a1e0f25c9d67e1e640cd9a09","02d734976af36f4273d930bea88b3e62adf6b078cf120c1c63d49aa8d8427c5c",{"version":"516a426e3960379f310107635b8f3a7e8c307c6c665080b128039d9299ec4087","affectsGlobalScope":true}],"options":{"composite":true,"declarationMap":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":2,"module":1,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"stripInternal":true,"target":5},"fileIdsList":[[106],[106,125,127],[63,106],[66,106],[67,72,106],[68,78,79,86,95,105,106],[68,69,78,86,106],[70,106],[71,72,79,87,106],[72,95,102,106],[73,75,78,86,106],[74,106],[75,76,106],[77,78,106],[78,106],[78,79,80,95,105,106],[78,79,80,95,106],[81,86,95,105,106],[78,79,81,82,86,95,102,105,106],[81,83,95,102,105,106],[63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],[78,84,106],[85,105,106],[75,78,86,95,106],[87,106],[88,106],[66,89,106],[90,104,106,110],[91,106],[92,106],[78,93,106],[93,94,106,108],[78,95,96,97,106],[95,97,106],[95,96,106],[98,106],[99,106],[78,100,101,106],[100,101,106],[72,86,102,106],[103,106],[86,104,106],[67,81,92,105,106],[72,106],[95,106,107],[106,108],[106,109],[67,72,78,80,89,95,105,106,108,110],[95,106,111],[106,121,122],[106,121,122,123,124],[106,126],[54,106],[53,63,106],[56,106],[54,56,58,106,116,117],[106,116],[58,63,106,115,120],[106,116,120],[62,106,114],[59,61,106],[60,106],[61,106],[106,113],[54,56,58,116,117],[58,115]],"referencedMap":[[53,1],[128,2],[63,3],[64,3],[66,4],[67,5],[68,6],[69,7],[70,8],[71,9],[72,10],[73,11],[74,12],[75,13],[76,13],[77,14],[78,15],[79,16],[80,17],[65,1],[112,1],[81,18],[82,19],[83,20],[113,21],[84,22],[85,23],[86,24],[87,25],[88,26],[89,27],[90,28],[91,29],[92,30],[93,31],[94,32],[95,33],[97,34],[96,35],[98,36],[99,37],[100,38],[101,39],[102,40],[103,41],[104,42],[105,43],[106,44],[107,45],[108,46],[109,47],[110,48],[111,49],[121,1],[123,50],[125,51],[124,50],[122,1],[127,52],[126,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[32,1],[33,1],[34,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[8,1],[46,1],[43,1],[44,1],[45,1],[47,1],[9,1],[48,1],[49,1],[50,1],[51,1],[1,1],[10,1],[52,1],[55,53],[54,54],[57,55],[56,54],[58,1],[118,56],[119,57],[116,58],[120,1],[117,59],[115,60],[60,61],[61,62],[59,1],[62,63],[114,64]],"exportedModulesMap":[[53,1],[128,2],[63,3],[64,3],[66,4],[67,5],[68,6],[69,7],[70,8],[71,9],[72,10],[73,11],[74,12],[75,13],[76,13],[77,14],[78,15],[79,16],[80,17],[65,1],[112,1],[81,18],[82,19],[83,20],[113,21],[84,22],[85,23],[86,24],[87,25],[88,26],[89,27],[90,28],[91,29],[92,30],[93,31],[94,32],[95,33],[97,34],[96,35],[98,36],[99,37],[100,38],[101,39],[102,40],[103,41],[104,42],[105,43],[106,44],[107,45],[108,46],[109,47],[110,48],[111,49],[121,1],[123,50],[125,51],[124,50],[122,1],[127,52],[126,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[32,1],[33,1],[34,1],[35,1],[7,1],[36,1],[41,1],[42,1],[37,1],[38,1],[39,1],[40,1],[8,1],[46,1],[43,1],[44,1],[45,1],[47,1],[9,1],[48,1],[49,1],[50,1],[51,1],[1,1],[10,1],[52,1],[118,65],[116,66],[120,1],[115,60],[60,61],[61,62],[59,1],[62,63],[114,64]],"semanticDiagnosticsPerFile":[53,128,63,64,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,65,112,81,82,83,113,84,85,86,87,88,89,90,91,92,93,94,95,97,96,98,99,100,101,102,103,104,105,106,107,108,109,110,111,121,123,125,124,122,127,126,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,36,41,42,37,38,39,40,8,46,43,44,45,47,9,48,49,50,51,1,10,52,55,54,57,56,58,118,119,116,120,117,115,60,61,59,62,114]},"version":"4.7.4"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/crypto",
3
- "version": "2.33.7-dev.c2ba88fb",
3
+ "version": "2.33.8-dev.8609bc45",
4
4
  "description": "Basic crypto key utils",
5
5
  "license": "MIT",
6
6
  "author": "DXOS.org",
@@ -11,13 +11,13 @@
11
11
  "src"
12
12
  ],
13
13
  "dependencies": {
14
- "bip39": "^3.0.4",
14
+ "@dxos/protocols": "2.33.8-dev.8609bc45",
15
15
  "crypto-js": "^3.1.9-1",
16
16
  "hypercore-crypto": "^2.3.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@dxos/eslint-plugin": "~1.0.34",
20
- "@dxos/protocols-toolchain": "2.33.6",
20
+ "@dxos/protocols-toolchain": "2.33.7",
21
21
  "@types/crypto-js": "~4.0.2",
22
22
  "@types/jest": "^26.0.7",
23
23
  "@types/node": "^16.11.27",
package/src/human-hash.ts CHANGED
@@ -45,7 +45,7 @@ const DEFAULT_WORDLIST = [
45
45
  /**
46
46
  * humanhash: Human-readable representations of digests.
47
47
  */
48
- // TODO(wittjosiah): Is this needed still?
48
+ // TODO(wittjosiah): Move to debug?
49
49
  export class HumanHasher {
50
50
  /**
51
51
  * Transforms hex digests to human-readable strings.
package/src/index.ts CHANGED
@@ -6,6 +6,4 @@ export * from './encrypt';
6
6
  export * from './hash';
7
7
  export * from './human-hash';
8
8
  export * from './keys';
9
- export * from './seedphrase';
10
9
  export * from './validator';
11
- export * from './public-key';
package/src/keys.ts CHANGED
@@ -5,12 +5,13 @@
5
5
  import assert from 'assert';
6
6
  import crypto from 'hypercore-crypto';
7
7
 
8
+ import { PublicKey, PublicKeyLike } from '@dxos/protocols';
9
+
8
10
  import { HumanHasher } from './human-hash';
9
- import { PublicKey, PublicKeyLike } from './public-key';
10
11
 
11
12
  export const hasher = new HumanHasher();
12
13
 
13
- export const PUBLIC_KEY_LENGTH = 32;
14
+ export const PUBLIC_KEY_LENGTH = 32; // TODO(wittjosiah): Move to protocols with PublicKey?
14
15
  export const SECRET_KEY_LENGTH = 64;
15
16
  export const SIGNATURE_LENGTH = 64;
16
17
 
@@ -52,7 +53,7 @@ export const keyToBuffer = (str: string): Buffer => {
52
53
  * @param {Buffer | Uint8Array} buffer - Key buffer.
53
54
  * @return {string} Hex string representation of key.
54
55
  */
55
- export const keyToString = (buffer: Buffer | Uint8Array | PublicKey): string => {
56
+ export const keyToString = (buffer: PublicKeyLike): string => {
56
57
  if (buffer instanceof PublicKey) {
57
58
  buffer = buffer.asBuffer();
58
59
  } else if (buffer instanceof Uint8Array) {
@@ -63,8 +64,8 @@ export const keyToString = (buffer: Buffer | Uint8Array | PublicKey): string =>
63
64
  return buffer.toString('hex');
64
65
  };
65
66
 
66
- export const humanize = (value: Buffer | Uint8Array | string): string => {
67
- if (value instanceof Buffer || value instanceof Uint8Array) {
67
+ export const humanize = (value: PublicKeyLike): string => {
68
+ if (value instanceof PublicKey || value instanceof Buffer || value instanceof Uint8Array) {
68
69
  value = keyToString(value);
69
70
  }
70
71
 
@@ -1,79 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { inspect } from 'util';
4
- export declare class PublicKey {
5
- private readonly _value;
6
- /**
7
- * Creates new instance of PublicKey automatically determining the input format.
8
- */
9
- static from(source: PublicKeyLike): PublicKey;
10
- /**
11
- * Creates new instance of PublicKey from hex string.
12
- */
13
- static fromHex(hex: string): PublicKey;
14
- static random(): PublicKey;
15
- /**
16
- * Tests if provided values is an instance of PublicKey.
17
- */
18
- static isPublicKey(value: any): value is PublicKey;
19
- /**
20
- * Asserts that provided values is an instance of PublicKey.
21
- */
22
- static assertValidPublicKey(value: any): asserts value is PublicKey;
23
- /**
24
- * Tests two keys for equality.
25
- */
26
- static equals(left: PublicKeyLike, right: PublicKeyLike): boolean;
27
- constructor(_value: Uint8Array);
28
- /**
29
- * Return underlying Uint8Array representation.
30
- */
31
- asUint8Array(): Uint8Array;
32
- /**
33
- * Covert this key to buffer.
34
- */
35
- asBuffer(): Buffer;
36
- /**
37
- * Convert this key to hex-encoded string.
38
- */
39
- toHex(): string;
40
- /**
41
- * Convert this key to human-readable representation.
42
- */
43
- humanize(): string;
44
- /**
45
- * Same as `PublicKey.humanize()`.
46
- */
47
- toString(): string;
48
- /**
49
- * Same as `PublicKey.humanize()`.
50
- */
51
- toJSON(): string;
52
- /**
53
- * Used by NodeJS to get textual representation of this object when it's printed with a `console.log` statement.
54
- */
55
- [inspect.custom](): string;
56
- /**
57
- * Test this key for equality with some other key.
58
- */
59
- equals(other: PublicKeyLike): boolean;
60
- }
61
- /**
62
- * All representations that can be converted to a PublicKey.
63
- */
64
- export declare type PublicKeyLike = PublicKey | Buffer | Uint8Array | string;
65
- export declare const publicKeySubstitutions: {
66
- 'dxos.halo.keys.PubKey': {
67
- encode: (value: PublicKey) => {
68
- data: Uint8Array;
69
- };
70
- decode: (value: any) => PublicKey;
71
- };
72
- 'dxos.halo.keys.PrivKey': {
73
- encode: (value: Buffer) => {
74
- data: Uint8Array;
75
- };
76
- decode: (value: any) => Buffer;
77
- };
78
- };
79
- //# sourceMappingURL=public-key.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public-key.d.ts","sourceRoot":"","sources":["../../src/public-key.ts"],"names":[],"mappings":";;AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAI/B,qBAAa,SAAS;IA2DlB,OAAO,CAAC,QAAQ,CAAC,MAAM;IA1DzB;;OAEG;IACH,MAAM,CAAC,IAAI,CAAE,MAAM,EAAE,aAAa,GAAG,SAAS;IAgB9C;;OAEG;IACH,MAAM,CAAC,OAAO,CAAE,GAAG,EAAE,MAAM;IAQ3B,MAAM,CAAC,MAAM,IAAK,SAAS;IAI3B;;OAEG;IACH,MAAM,CAAC,WAAW,CAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS;IAInD;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,KAAK,IAAI,SAAS;IAMpE;;OAEG;IACH,MAAM,CAAC,MAAM,CAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa;gBAKrC,MAAM,EAAE,UAAU;IAOrC;;OAEG;IACH,YAAY,IAAK,UAAU;IAI3B;;OAEG;IACH,QAAQ,IAAK,MAAM;IAInB;;OAEG;IACH,KAAK,IAAK,MAAM;IAIhB;;OAEG;IACH,QAAQ,IAAK,MAAM;IAInB;;OAEG;IACH,QAAQ,IAAK,MAAM;IAInB;;OAEG;IACH,MAAM;IAIN;;OAEG;IACH,CAAC,OAAO,CAAC,MAAM,CAAC;IAIhB;;OAEG;IACH,MAAM,CAAE,KAAK,EAAE,aAAa;CAY7B;AAED;;GAEG;AAEH,oBAAY,aAAa,GACrB,SAAS,GACT,MAAM,GACN,UAAU,GACV,MAAM,CAAA;AAIV,eAAO,MAAM,sBAAsB;;wBAGf,SAAS;;;wBACT,GAAG;;;wBAIH,MAAM;;;wBACN,GAAG;;CAEtB,CAAC"}
@@ -1,147 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.publicKeySubstitutions = exports.PublicKey = void 0;
10
- const hypercore_crypto_1 = __importDefault(require("hypercore-crypto"));
11
- const util_1 = require("util");
12
- const human_hash_1 = require("./human-hash");
13
- class PublicKey {
14
- constructor(_value) {
15
- this._value = _value;
16
- if (!(_value instanceof Uint8Array)) {
17
- throw new TypeError(`Expected Uint8Array, got: ${_value}`);
18
- }
19
- }
20
- /**
21
- * Creates new instance of PublicKey automatically determining the input format.
22
- */
23
- static from(source) {
24
- if (source instanceof PublicKey) {
25
- return source;
26
- }
27
- else if (source instanceof Buffer) {
28
- return new PublicKey(new Uint8Array(source));
29
- }
30
- else if (source instanceof Uint8Array) {
31
- return new PublicKey(source);
32
- }
33
- else if (typeof source === 'string') {
34
- return PublicKey.fromHex(source);
35
- }
36
- else if (source.asUint8Array) {
37
- return new PublicKey(source.asUint8Array());
38
- }
39
- else {
40
- throw new TypeError(`Unable to create PublicKey from ${source}`);
41
- }
42
- }
43
- /**
44
- * Creates new instance of PublicKey from hex string.
45
- */
46
- static fromHex(hex) {
47
- if (hex.startsWith('0x')) {
48
- hex = hex.slice(2);
49
- }
50
- return new PublicKey(new Uint8Array(Buffer.from(hex, 'hex')));
51
- }
52
- static random() {
53
- return PublicKey.from(hypercore_crypto_1.default.randomBytes(32));
54
- }
55
- /**
56
- * Tests if provided values is an instance of PublicKey.
57
- */
58
- static isPublicKey(value) {
59
- return value instanceof PublicKey;
60
- }
61
- /**
62
- * Asserts that provided values is an instance of PublicKey.
63
- */
64
- static assertValidPublicKey(value) {
65
- if (!this.isPublicKey(value)) {
66
- throw new TypeError('Invalid PublicKey');
67
- }
68
- }
69
- /**
70
- * Tests two keys for equality.
71
- */
72
- static equals(left, right) {
73
- return PublicKey.from(left).equals(right);
74
- }
75
- /**
76
- * Return underlying Uint8Array representation.
77
- */
78
- asUint8Array() {
79
- return this._value;
80
- }
81
- /**
82
- * Covert this key to buffer.
83
- */
84
- asBuffer() {
85
- return Buffer.from(this._value);
86
- }
87
- /**
88
- * Convert this key to hex-encoded string.
89
- */
90
- toHex() {
91
- return this.asBuffer().toString('hex');
92
- }
93
- /**
94
- * Convert this key to human-readable representation.
95
- */
96
- humanize() {
97
- return hasher.humanize(this.toHex());
98
- }
99
- /**
100
- * Same as `PublicKey.humanize()`.
101
- */
102
- toString() {
103
- return this.toHex();
104
- }
105
- /**
106
- * Same as `PublicKey.humanize()`.
107
- */
108
- toJSON() {
109
- return this.toHex();
110
- }
111
- /**
112
- * Used by NodeJS to get textual representation of this object when it's printed with a `console.log` statement.
113
- */
114
- [util_1.inspect.custom]() {
115
- return `<PublicKey ${this.humanize()}>`;
116
- }
117
- /**
118
- * Test this key for equality with some other key.
119
- */
120
- equals(other) {
121
- const otherConverted = PublicKey.from(other);
122
- if (this._value.length !== otherConverted._value.length) {
123
- return false;
124
- }
125
- let equal = true;
126
- this._value;
127
- for (let i = 0; i < this._value.length; i++) {
128
- equal && (equal = this._value[i] === otherConverted._value[i]);
129
- }
130
- return equal;
131
- }
132
- }
133
- exports.PublicKey = PublicKey;
134
- const hasher = new human_hash_1.HumanHasher();
135
- exports.publicKeySubstitutions = {
136
- // TODO(dmaretskyi): Rename to dxos.crypto.PublicKey.
137
- 'dxos.halo.keys.PubKey': {
138
- encode: (value) => ({ data: value.asUint8Array() }),
139
- decode: (value) => PublicKey.from(new Uint8Array(value.data))
140
- },
141
- // TODO(dmaretskyi): Shouldn't be substitutted to PublicKey.
142
- 'dxos.halo.keys.PrivKey': {
143
- encode: (value) => ({ data: new Uint8Array(value) }),
144
- decode: (value) => PublicKey.from(new Uint8Array(value.data)).asBuffer()
145
- }
146
- };
147
- //# sourceMappingURL=public-key.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public-key.js","sourceRoot":"","sources":["../../src/public-key.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,wEAAsC;AACtC,+BAA+B;AAE/B,6CAA2C;AAE3C,MAAa,SAAS;IA0DpB,YACmB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAEnC,IAAI,CAAC,CAAC,MAAM,YAAY,UAAU,CAAC,EAAE;YACnC,MAAM,IAAI,SAAS,CAAC,6BAA6B,MAAM,EAAE,CAAC,CAAC;SAC5D;IACH,CAAC;IA/DD;;OAEG;IACH,MAAM,CAAC,IAAI,CAAE,MAAqB;QAChC,IAAI,MAAM,YAAY,SAAS,EAAE;YAC/B,OAAO,MAAM,CAAC;SACf;aAAM,IAAI,MAAM,YAAY,MAAM,EAAE;YACnC,OAAO,IAAI,SAAS,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;SAC9C;aAAM,IAAI,MAAM,YAAY,UAAU,EAAE;YACvC,OAAO,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;SAC9B;aAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EA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gB,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,EAAE,CAAC;QAC9D,MAAM,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACnE;IACD,4DAA4D;IAC5D,wBAAwB,EAAE;QACxB,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5D,MAAM,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE;KAC9E;CACF,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=public-key.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public-key.test.d.ts","sourceRoot":"","sources":["../../src/public-key.test.ts"],"names":[],"mappings":""}
@@ -1,41 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const keys_1 = require("./keys");
7
- const public_key_1 = require("./public-key");
8
- const KEY_HEX = '2c28f0d08ccc5340aee02655675be5796227a28d27b9704df34b7d8b2d9fddc7';
9
- it('formatting', () => {
10
- const key = public_key_1.PublicKey.fromHex(KEY_HEX);
11
- expect(public_key_1.PublicKey.isPublicKey(key)).toEqual(true);
12
- public_key_1.PublicKey.assertValidPublicKey(key);
13
- expect(key.humanize()).toEqual('lemon-nitrogen-sixteen-undress');
14
- expect(key.toHex()).toEqual(KEY_HEX);
15
- });
16
- it('asBuffer', () => {
17
- const key = public_key_1.PublicKey.fromHex(KEY_HEX);
18
- const buffer = key.asBuffer();
19
- expect(buffer).toBeInstanceOf(Buffer);
20
- expect(Buffer.from(KEY_HEX, 'hex').equals(buffer)).toEqual(true);
21
- });
22
- it('asUint8Array', () => {
23
- const key = public_key_1.PublicKey.fromHex(KEY_HEX);
24
- const array = key.asUint8Array();
25
- expect(array).toBeInstanceOf(Uint8Array);
26
- expect(Buffer.from(KEY_HEX, 'hex').equals(Buffer.from(array))).toEqual(true);
27
- expect(public_key_1.PublicKey.from(Buffer.from(KEY_HEX, 'hex')).asUint8Array()).toBeInstanceOf(Uint8Array);
28
- });
29
- it('from', () => {
30
- expect(public_key_1.PublicKey.from(KEY_HEX).toHex())
31
- .toEqual(KEY_HEX);
32
- expect(public_key_1.PublicKey.from(Buffer.from(KEY_HEX, 'hex')).toHex())
33
- .toEqual(KEY_HEX);
34
- expect(public_key_1.PublicKey.from(new Uint8Array(32)).toHex())
35
- .toEqual('0000000000000000000000000000000000000000000000000000000000000000');
36
- });
37
- it('equals', () => {
38
- expect(public_key_1.PublicKey.equals(public_key_1.PublicKey.from(KEY_HEX), public_key_1.PublicKey.from(KEY_HEX))).toEqual(true);
39
- expect(public_key_1.PublicKey.equals(public_key_1.PublicKey.from((0, keys_1.randomBytes)()), public_key_1.PublicKey.from((0, keys_1.randomBytes)()))).toEqual(false);
40
- });
41
- //# sourceMappingURL=public-key.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public-key.test.js","sourceRoot":"","sources":["../../src/public-key.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,iCAAqC;AACrC,6CAAyC;AAEzC,MAAM,OAAO,GAAG,kEAAkE,CAAC;AAEnF,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;IACpB,MAAM,GAAG,GAAG,sBAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvC,MAAM,CAAC,sBAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,sBAAS,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAEpC,M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,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;SACpC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpB,MAAM,CAAC,sBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;SACxD,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpB,MAAM,CAAC,sBAAS,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;SAC/C,OAAO,CAAC,kEAAkE,CAAC,CAAC;AACjF,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;IAChB,MAAM,CAAC,sBAAS,CAAC,MAAM,CACrB,sBAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EACvB,sBAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CACxB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,MAAM,CAAC,sBAAS,CAAC,MAAM,CACrB,sBAAS,CAAC,IAAI,CAAC,IAAA,kBAAW,GAAE,CAAC,EAC7B,sBAAS,CAAC,IAAI,CAAC,IAAA,kBAAW,GAAE,CAAC,CAC9B,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Generate bip39 seed phrase (aka mnemonic).
3
- */
4
- export declare const generateSeedPhrase: () => string;
5
- /**
6
- * Generate key pair from seed phrase.
7
- */
8
- export declare const keyPairFromSeedPhrase: (seedPhrase: string) => import("./keys").KeyPair;
9
- //# sourceMappingURL=seedphrase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seedphrase.d.ts","sourceRoot":"","sources":["../../src/seedphrase.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,eAAO,MAAM,kBAAkB,QAAO,MAA4B,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,qBAAqB,eAAgB,MAAM,6BAIvD,CAAC"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.keyPairFromSeedPhrase = exports.generateSeedPhrase = void 0;
10
- const assert_1 = __importDefault(require("assert"));
11
- const bip39_1 = require("bip39");
12
- const keys_1 = require("./keys");
13
- // Util functions for Identity: export, import, create.
14
- /**
15
- * Generate bip39 seed phrase (aka mnemonic).
16
- */
17
- const generateSeedPhrase = () => (0, bip39_1.generateMnemonic)();
18
- exports.generateSeedPhrase = generateSeedPhrase;
19
- /**
20
- * Generate key pair from seed phrase.
21
- */
22
- const keyPairFromSeedPhrase = (seedPhrase) => {
23
- (0, assert_1.default)(seedPhrase);
24
- const seed = (0, bip39_1.mnemonicToSeedSync)(seedPhrase);
25
- return (0, keys_1.createKeyPair)(seed);
26
- };
27
- exports.keyPairFromSeedPhrase = keyPairFromSeedPhrase;
28
- //# sourceMappingURL=seedphrase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seedphrase.js","sourceRoot":"","sources":["../../src/seedphrase.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA4B;AAC5B,iCAA6D;AAE7D,iCAAuC;AAEvC,uDAAuD;AAEvD;;GAEG;AACI,MAAM,kBAAkB,GAAG,GAAW,EAAE,CAAC,IAAA,wBAAgB,GAAE,CAAC;AAAtD,QAAA,kBAAkB,sBAAoC;AAEnE;;GAEG;AACI,MAAM,qBAAqB,GAAG,CAAC,UAAkB,EAAE,EAAE;IAC1D,IAAA,gBAAM,EAAC,UAAU,CAAC,CAAC;IACnB,MAAM,IAAI,GAAG,IAAA,0BAAkB,EAAC,UAAU,CAAC,CAAC;IAC5C,OAAO,IAAA,oBAAa,EAAC,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAJW,QAAA,qBAAqB,yBAIhC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=seedphrase.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seedphrase.test.d.ts","sourceRoot":"","sources":["../../src/seedphrase.test.ts"],"names":[],"mappings":""}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2020 DXOS.org
4
- //
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const bip39_1 = require("bip39");
7
- const keys_1 = require("./keys");
8
- const seedphrase_1 = require("./seedphrase");
9
- it('Basic bip39 operations work', async () => {
10
- const seedPhrase = (0, bip39_1.generateMnemonic)();
11
- const seed = (0, bip39_1.mnemonicToSeedSync)(seedPhrase);
12
- await (0, keys_1.createKeyPair)(seed.slice(0, 32));
13
- });
14
- it('Create keypair from seedphrase', async () => {
15
- const seedPhrase = (0, seedphrase_1.generateSeedPhrase)();
16
- expect(typeof seedPhrase).toBe('string');
17
- expect(seedPhrase.split(/\s+/g).length).toEqual(12);
18
- const recoveredKeyPair = (0, seedphrase_1.keyPairFromSeedPhrase)(seedPhrase);
19
- expect(recoveredKeyPair).toBeDefined();
20
- });
21
- //# sourceMappingURL=seedphrase.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"seedphrase.test.js","sourceRoot":"","sources":["../../src/seedphrase.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;AAEF,iCAA6D;AAE7D,iCAAuC;AACvC,6CAAyE;AAEzE,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;IAC3C,MAAM,UAAU,GAAG,IAAA,wBAAgB,GAAE,CAAC;IACtC,MAAM,IAAI,GAAG,IAAA,0BAAkB,EAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,IAAA,oBAAa,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC;AAEH,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;IAC9C,MAAM,UAAU,GAAG,IAAA,+BAAkB,GAAE,CAAC;IACxC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAEpD,MAAM,gBAAgB,GAAG,IAAA,kCAAqB,EAAC,UAAU,CAAC,CAAC;IAC3D,MAAM,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC;AACzC,CAAC,CAAC,CAAC"}
@@ -1,60 +0,0 @@
1
- //
2
- // Copyright 2020 DXOS.org
3
- //
4
-
5
- import { randomBytes } from './keys';
6
- import { PublicKey } from './public-key';
7
-
8
- const KEY_HEX = '2c28f0d08ccc5340aee02655675be5796227a28d27b9704df34b7d8b2d9fddc7';
9
-
10
- it('formatting', () => {
11
- const key = PublicKey.fromHex(KEY_HEX);
12
-
13
- expect(PublicKey.isPublicKey(key)).toEqual(true);
14
- PublicKey.assertValidPublicKey(key);
15
-
16
- expect(key.humanize()).toEqual('lemon-nitrogen-sixteen-undress');
17
- expect(key.toHex()).toEqual(KEY_HEX);
18
- });
19
-
20
- it('asBuffer', () => {
21
- const key = PublicKey.fromHex(KEY_HEX);
22
- const buffer = key.asBuffer();
23
-
24
- expect(buffer).toBeInstanceOf(Buffer);
25
-
26
- expect(Buffer.from(KEY_HEX, 'hex').equals(buffer)).toEqual(true);
27
- });
28
-
29
- it('asUint8Array', () => {
30
- const key = PublicKey.fromHex(KEY_HEX);
31
-
32
- const array = key.asUint8Array();
33
- expect(array).toBeInstanceOf(Uint8Array);
34
- expect(Buffer.from(KEY_HEX, 'hex').equals(Buffer.from(array))).toEqual(true);
35
-
36
- expect(PublicKey.from(Buffer.from(KEY_HEX, 'hex')).asUint8Array()).toBeInstanceOf(Uint8Array);
37
- });
38
-
39
- it('from', () => {
40
- expect(PublicKey.from(KEY_HEX).toHex())
41
- .toEqual(KEY_HEX);
42
-
43
- expect(PublicKey.from(Buffer.from(KEY_HEX, 'hex')).toHex())
44
- .toEqual(KEY_HEX);
45
-
46
- expect(PublicKey.from(new Uint8Array(32)).toHex())
47
- .toEqual('0000000000000000000000000000000000000000000000000000000000000000');
48
- });
49
-
50
- it('equals', () => {
51
- expect(PublicKey.equals(
52
- PublicKey.from(KEY_HEX),
53
- PublicKey.from(KEY_HEX)
54
- )).toEqual(true);
55
-
56
- expect(PublicKey.equals(
57
- PublicKey.from(randomBytes()),
58
- PublicKey.from(randomBytes())
59
- )).toEqual(false);
60
- });
package/src/public-key.ts DELETED
@@ -1,165 +0,0 @@
1
- //
2
- // Copyright 2020 DXOS.org
3
- //
4
-
5
- import crypto from 'hypercore-crypto';
6
- import { inspect } from 'util';
7
-
8
- import { HumanHasher } from './human-hash';
9
-
10
- export class PublicKey {
11
- /**
12
- * Creates new instance of PublicKey automatically determining the input format.
13
- */
14
- static from (source: PublicKeyLike): PublicKey {
15
- if (source instanceof PublicKey) {
16
- return source;
17
- } else if (source instanceof Buffer) {
18
- return new PublicKey(new Uint8Array(source));
19
- } else if (source instanceof Uint8Array) {
20
- return new PublicKey(source);
21
- } else if (typeof source === 'string') {
22
- return PublicKey.fromHex(source);
23
- } else if ((<any>source).asUint8Array) {
24
- return new PublicKey((<any>source).asUint8Array());
25
- } else {
26
- throw new TypeError(`Unable to create PublicKey from ${source}`);
27
- }
28
- }
29
-
30
- /**
31
- * Creates new instance of PublicKey from hex string.
32
- */
33
- static fromHex (hex: string) {
34
- if (hex.startsWith('0x')) {
35
- hex = hex.slice(2);
36
- }
37
-
38
- return new PublicKey(new Uint8Array(Buffer.from(hex, 'hex')));
39
- }
40
-
41
- static random (): PublicKey {
42
- return PublicKey.from(crypto.randomBytes(32));
43
- }
44
-
45
- /**
46
- * Tests if provided values is an instance of PublicKey.
47
- */
48
- static isPublicKey (value: any): value is PublicKey {
49
- return value instanceof PublicKey;
50
- }
51
-
52
- /**
53
- * Asserts that provided values is an instance of PublicKey.
54
- */
55
- static assertValidPublicKey (value: any): asserts value is PublicKey {
56
- if (!this.isPublicKey(value)) {
57
- throw new TypeError('Invalid PublicKey');
58
- }
59
- }
60
-
61
- /**
62
- * Tests two keys for equality.
63
- */
64
- static equals (left: PublicKeyLike, right: PublicKeyLike) {
65
- return PublicKey.from(left).equals(right);
66
- }
67
-
68
- constructor (
69
- private readonly _value: Uint8Array
70
- ) {
71
- if (!(_value instanceof Uint8Array)) {
72
- throw new TypeError(`Expected Uint8Array, got: ${_value}`);
73
- }
74
- }
75
-
76
- /**
77
- * Return underlying Uint8Array representation.
78
- */
79
- asUint8Array (): Uint8Array {
80
- return this._value;
81
- }
82
-
83
- /**
84
- * Covert this key to buffer.
85
- */
86
- asBuffer (): Buffer {
87
- return Buffer.from(this._value);
88
- }
89
-
90
- /**
91
- * Convert this key to hex-encoded string.
92
- */
93
- toHex (): string {
94
- return this.asBuffer().toString('hex');
95
- }
96
-
97
- /**
98
- * Convert this key to human-readable representation.
99
- */
100
- humanize (): string {
101
- return hasher.humanize(this.toHex());
102
- }
103
-
104
- /**
105
- * Same as `PublicKey.humanize()`.
106
- */
107
- toString (): string {
108
- return this.toHex();
109
- }
110
-
111
- /**
112
- * Same as `PublicKey.humanize()`.
113
- */
114
- toJSON () {
115
- return this.toHex();
116
- }
117
-
118
- /**
119
- * Used by NodeJS to get textual representation of this object when it's printed with a `console.log` statement.
120
- */
121
- [inspect.custom] () {
122
- return `<PublicKey ${this.humanize()}>`;
123
- }
124
-
125
- /**
126
- * Test this key for equality with some other key.
127
- */
128
- equals (other: PublicKeyLike) {
129
- const otherConverted = PublicKey.from(other);
130
- if (this._value.length !== otherConverted._value.length) {
131
- return false;
132
- }
133
- let equal = true;
134
- this._value;
135
- for (let i = 0; i < this._value.length; i++) {
136
- equal &&= this._value[i] === otherConverted._value[i];
137
- }
138
- return equal;
139
- }
140
- }
141
-
142
- /**
143
- * All representations that can be converted to a PublicKey.
144
- */
145
- // TODO(burdon): Remove this.
146
- export type PublicKeyLike =
147
- | PublicKey
148
- | Buffer
149
- | Uint8Array
150
- | string
151
-
152
- const hasher = new HumanHasher();
153
-
154
- export const publicKeySubstitutions = {
155
- // TODO(dmaretskyi): Rename to dxos.crypto.PublicKey.
156
- 'dxos.halo.keys.PubKey': {
157
- encode: (value: PublicKey) => ({ data: value.asUint8Array() }),
158
- decode: (value: any) => PublicKey.from(new Uint8Array(value.data))
159
- },
160
- // TODO(dmaretskyi): Shouldn't be substitutted to PublicKey.
161
- 'dxos.halo.keys.PrivKey': {
162
- encode: (value: Buffer) => ({ data: new Uint8Array(value) }),
163
- decode: (value: any) => PublicKey.from(new Uint8Array(value.data)).asBuffer()
164
- }
165
- };
@@ -1,23 +0,0 @@
1
- //
2
- // Copyright 2020 DXOS.org
3
- //
4
-
5
- import { generateMnemonic, mnemonicToSeedSync } from 'bip39';
6
-
7
- import { createKeyPair } from './keys';
8
- import { generateSeedPhrase, keyPairFromSeedPhrase } from './seedphrase';
9
-
10
- it('Basic bip39 operations work', async () => {
11
- const seedPhrase = generateMnemonic();
12
- const seed = mnemonicToSeedSync(seedPhrase);
13
- await createKeyPair(seed.slice(0, 32));
14
- });
15
-
16
- it('Create keypair from seedphrase', async () => {
17
- const seedPhrase = generateSeedPhrase();
18
- expect(typeof seedPhrase).toBe('string');
19
- expect(seedPhrase.split(/\s+/g).length).toEqual(12);
20
-
21
- const recoveredKeyPair = keyPairFromSeedPhrase(seedPhrase);
22
- expect(recoveredKeyPair).toBeDefined();
23
- });
package/src/seedphrase.ts DELETED
@@ -1,24 +0,0 @@
1
- //
2
- // Copyright 2020 DXOS.org
3
- //
4
-
5
- import assert from 'assert';
6
- import { generateMnemonic, mnemonicToSeedSync } from 'bip39';
7
-
8
- import { createKeyPair } from './keys';
9
-
10
- // Util functions for Identity: export, import, create.
11
-
12
- /**
13
- * Generate bip39 seed phrase (aka mnemonic).
14
- */
15
- export const generateSeedPhrase = (): string => generateMnemonic();
16
-
17
- /**
18
- * Generate key pair from seed phrase.
19
- */
20
- export const keyPairFromSeedPhrase = (seedPhrase: string) => {
21
- assert(seedPhrase);
22
- const seed = mnemonicToSeedSync(seedPhrase);
23
- return createKeyPair(seed);
24
- };