@waku/message-encryption 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/bundle/ecies.js +1 -1
- package/bundle/{index-1b28e2e5.js → index-fb7e6ca5.js} +5 -1
- package/bundle/index.js +1 -1
- package/bundle/symmetric.js +1 -1
- package/dist/ecies.d.ts +2 -2
- package/dist/ecies.js +2 -2
- package/dist/ecies.js.map +1 -1
- package/dist/symmetric.d.ts +2 -2
- package/dist/symmetric.js +2 -2
- package/dist/symmetric.js.map +1 -1
- package/package.json +5 -4
- package/src/ecies.ts +2 -2
- package/src/symmetric.ts +2 -2
package/CHANGELOG.md
CHANGED
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.0.9] - 2023-01-25
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
- Moved `@chai` and `@fast-check` to `devDependencies` list.
|
15
|
+
|
16
|
+
## [0.0.8] - 2023-01-18
|
17
|
+
|
18
|
+
### Changed
|
19
|
+
|
20
|
+
- Export `Encoder` and `Decoder` types.
|
21
|
+
- Moved `@chai` and `@fast-check` to `dependencies` list.
|
22
|
+
- Added missing `@js-sha3` and `@debug` to `dependencies` list.
|
23
|
+
|
10
24
|
## [0.0.7] - 2022-12-19
|
11
25
|
|
12
26
|
### Fixed
|
@@ -40,7 +54,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
40
54
|
|
41
55
|
- Alpha version of `@waku/message-encryption`.
|
42
56
|
|
43
|
-
[unreleased]: https://github.com/waku-org/js-waku/compare/@waku/message-encryption@0.0.
|
57
|
+
[unreleased]: https://github.com/waku-org/js-waku/compare/@waku/message-encryption@0.0.9...HEAD
|
58
|
+
[0.0.9]: https://github.com/waku-org/js-waku/compare/@waku/message-encryption@0.0.8...@waku/message-encryption@0.0.9
|
59
|
+
[0.0.8]: https://github.com/waku-org/js-waku/compare/@waku/message-encryption@0.0.7...@waku/message-encryption@0.0.8
|
44
60
|
[0.0.7]: https://github.com/waku-org/js-waku/compare/@waku/message-encryption@0.0.6...@waku/message-encryption@0.0.7
|
45
61
|
[0.0.6]: https://github.com/waku-org/js-waku/compare/@waku/message-encryption@0.0.5...@waku/message-encryption@0.0.6
|
46
62
|
[0.0.5]: https://github.com/waku-org/js-waku/compare/@waku/message-encryption@0.0.4...@waku/message-encryption@0.0.5
|
package/bundle/ecies.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { D as DecodedMessage, b as createDecoder, c as createEncoder, g as generatePrivateKey, a as getPublicKey } from './index-
|
1
|
+
export { D as DecodedMessage, b as Decoder, E as Encoder, d as createDecoder, c as createEncoder, g as generatePrivateKey, a as getPublicKey } from './index-fb7e6ca5.js';
|
@@ -15146,7 +15146,9 @@ var ecies = /*#__PURE__*/Object.freeze({
|
|
15146
15146
|
DecodedMessage: DecodedMessage,
|
15147
15147
|
generatePrivateKey: generatePrivateKey,
|
15148
15148
|
getPublicKey: getPublicKey,
|
15149
|
+
Encoder: Encoder$1,
|
15149
15150
|
createEncoder: createEncoder$1,
|
15151
|
+
Decoder: Decoder$1,
|
15150
15152
|
createDecoder: createDecoder$1
|
15151
15153
|
});
|
15152
15154
|
|
@@ -15260,7 +15262,9 @@ var symmetric = /*#__PURE__*/Object.freeze({
|
|
15260
15262
|
__proto__: null,
|
15261
15263
|
DecodedMessage: DecodedMessage,
|
15262
15264
|
generateSymmetricKey: generateSymmetricKey,
|
15265
|
+
Encoder: Encoder,
|
15263
15266
|
createEncoder: createEncoder,
|
15267
|
+
Decoder: Decoder,
|
15264
15268
|
createDecoder: createDecoder
|
15265
15269
|
});
|
15266
15270
|
|
@@ -15278,4 +15282,4 @@ class DecodedMessage extends DecodedMessage$1 {
|
|
15278
15282
|
}
|
15279
15283
|
}
|
15280
15284
|
|
15281
|
-
export { DecodedMessage as D, OneMillion as O, Version as V, getPublicKey as a,
|
15285
|
+
export { DecodedMessage as D, Encoder$1 as E, OneMillion as O, Version as V, getPublicKey as a, Decoder$1 as b, createEncoder$1 as c, createDecoder$1 as d, generateSymmetricKey as e, Encoder as f, generatePrivateKey as g, createEncoder as h, Decoder as i, createDecoder as j, ecies as k, symmetric as s };
|
package/bundle/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { D as DecodedMessage, O as OneMillion, V as Version,
|
1
|
+
export { D as DecodedMessage, O as OneMillion, V as Version, k as ecies, g as generatePrivateKey, e as generateSymmetricKey, a as getPublicKey, s as symmetric } from './index-fb7e6ca5.js';
|
package/bundle/symmetric.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { D as DecodedMessage, f as createDecoder,
|
1
|
+
export { D as DecodedMessage, i as Decoder, f as Encoder, j as createDecoder, h as createEncoder, e as generateSymmetricKey } from './index-fb7e6ca5.js';
|
package/dist/ecies.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { Decoder as DecoderV0 } from "@waku/core/lib/message/version_0";
|
|
2
2
|
import type { IDecoder, IEncoder, IMessage, IProtoMessage } from "@waku/interfaces";
|
3
3
|
import { DecodedMessage, generatePrivateKey, getPublicKey } from "./index.js";
|
4
4
|
export { DecodedMessage, generatePrivateKey, getPublicKey };
|
5
|
-
declare class Encoder implements IEncoder {
|
5
|
+
export declare class Encoder implements IEncoder {
|
6
6
|
contentTopic: string;
|
7
7
|
private publicKey;
|
8
8
|
private sigPrivKey?;
|
@@ -30,7 +30,7 @@ declare class Encoder implements IEncoder {
|
|
30
30
|
* @param ephemeral An optional flag to mark message as ephemeral, ie, not to be stored by Waku Store nodes.
|
31
31
|
*/
|
32
32
|
export declare function createEncoder(contentTopic: string, publicKey: Uint8Array, sigPrivKey?: Uint8Array, ephemeral?: boolean): Encoder;
|
33
|
-
declare class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> {
|
33
|
+
export declare class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> {
|
34
34
|
private privateKey;
|
35
35
|
constructor(contentTopic: string, privateKey: Uint8Array);
|
36
36
|
fromProtoObj(protoMessage: IProtoMessage): Promise<DecodedMessage | undefined>;
|
package/dist/ecies.js
CHANGED
@@ -5,7 +5,7 @@ import { decryptAsymmetric, encryptAsymmetric, postCipher, preCipher, } from "./
|
|
5
5
|
import { DecodedMessage, generatePrivateKey, getPublicKey, OneMillion, Version, } from "./index.js";
|
6
6
|
export { DecodedMessage, generatePrivateKey, getPublicKey };
|
7
7
|
const log = debug("waku:message-encryption:ecies");
|
8
|
-
class Encoder {
|
8
|
+
export class Encoder {
|
9
9
|
constructor(contentTopic, publicKey, sigPrivKey, ephemeral = false) {
|
10
10
|
this.contentTopic = contentTopic;
|
11
11
|
this.publicKey = publicKey;
|
@@ -57,7 +57,7 @@ class Encoder {
|
|
57
57
|
export function createEncoder(contentTopic, publicKey, sigPrivKey, ephemeral = false) {
|
58
58
|
return new Encoder(contentTopic, publicKey, sigPrivKey, ephemeral);
|
59
59
|
}
|
60
|
-
class Decoder extends DecoderV0 {
|
60
|
+
export class Decoder extends DecoderV0 {
|
61
61
|
constructor(contentTopic, privateKey) {
|
62
62
|
super(contentTopic);
|
63
63
|
this.privateKey = privateKey;
|
package/dist/ecies.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ecies.js","sourceRoot":"","sources":["../src/ecies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAOxE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,OAAO,GACR,MAAM,YAAY,CAA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,YAAY,EAAE,CAAC,CAAC;YACnE,OAAO;SACR;QAED,IAAI;YACF,OAAO,GAAG,MAAM,iBAAiB,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;SACnE;QAAC,OAAO,CAAC,EAAE;YACV,GAAG,CACD,2EAA2E,IAAI,CAAC,YAAY,EAAE,EAC9F,CAAC,CACF,CAAC;YACF,OAAO;SACR;QAED,IAAI,CAAC,OAAO,EAAE;YACZ,GAAG,CAAC,8CAA8C,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YACvE,OAAO;SACR;QAED,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;QAEtC,IAAI,CAAC,GAAG,EAAE;YACR,GAAG,CAAC,6CAA6C,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YACtE,OAAO;SACR;QAED,GAAG,CAAC,mBAAmB,EAAE,YAAY,CAAC,CAAC;QACvC,OAAO,IAAI,cAAc,CACvB,YAAY,EACZ,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,GAAG,EAAE,SAAS,EAClB,GAAG,CAAC,GAAG,EAAE,SAAS,CACnB,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAC3B,YAAoB,EACpB,UAAsB;IAEtB,OAAO,IAAI,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AAC/C,CAAC"}
|
package/dist/symmetric.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { Decoder as DecoderV0 } from "@waku/core/lib/message/version_0";
|
|
2
2
|
import type { IDecoder, IEncoder, IMessage, IProtoMessage } from "@waku/interfaces";
|
3
3
|
import { DecodedMessage, generateSymmetricKey } from "./index.js";
|
4
4
|
export { DecodedMessage, generateSymmetricKey };
|
5
|
-
declare class Encoder implements IEncoder {
|
5
|
+
export declare class Encoder implements IEncoder {
|
6
6
|
contentTopic: string;
|
7
7
|
private symKey;
|
8
8
|
private sigPrivKey?;
|
@@ -30,7 +30,7 @@ declare class Encoder implements IEncoder {
|
|
30
30
|
* @param ephemeral An optional flag to mark message as ephemeral, ie, not to be stored by Waku Store nodes.
|
31
31
|
*/
|
32
32
|
export declare function createEncoder(contentTopic: string, symKey: Uint8Array, sigPrivKey?: Uint8Array, ephemeral?: boolean): Encoder;
|
33
|
-
declare class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> {
|
33
|
+
export declare class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> {
|
34
34
|
private symKey;
|
35
35
|
constructor(contentTopic: string, symKey: Uint8Array);
|
36
36
|
fromProtoObj(protoMessage: IProtoMessage): Promise<DecodedMessage | undefined>;
|
package/dist/symmetric.js
CHANGED
@@ -5,7 +5,7 @@ import { decryptSymmetric, encryptSymmetric, postCipher, preCipher, } from "./wa
|
|
5
5
|
import { DecodedMessage, generateSymmetricKey, OneMillion, Version, } from "./index.js";
|
6
6
|
export { DecodedMessage, generateSymmetricKey };
|
7
7
|
const log = debug("waku:message-encryption:symmetric");
|
8
|
-
class Encoder {
|
8
|
+
export class Encoder {
|
9
9
|
constructor(contentTopic, symKey, sigPrivKey, ephemeral = false) {
|
10
10
|
this.contentTopic = contentTopic;
|
11
11
|
this.symKey = symKey;
|
@@ -57,7 +57,7 @@ class Encoder {
|
|
57
57
|
export function createEncoder(contentTopic, symKey, sigPrivKey, ephemeral = false) {
|
58
58
|
return new Encoder(contentTopic, symKey, sigPrivKey, ephemeral);
|
59
59
|
}
|
60
|
-
class Decoder extends DecoderV0 {
|
60
|
+
export class Decoder extends DecoderV0 {
|
61
61
|
constructor(contentTopic, symKey) {
|
62
62
|
super(contentTopic);
|
63
63
|
this.symKey = symKey;
|
package/dist/symmetric.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"symmetric.js","sourceRoot":"","sources":["../src/symmetric.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAOxE,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
"description": "Waku Message Payload Encryption",
|
5
5
|
"types": "./dist/index.d.ts",
|
6
6
|
"module": "./dist/index.js",
|
@@ -78,6 +78,7 @@
|
|
78
78
|
"@waku/core": "*",
|
79
79
|
"@waku/interfaces": "*",
|
80
80
|
"@waku/proto": "*",
|
81
|
+
"debug": "^4.3.4",
|
81
82
|
"js-sha3": "^0.8.0"
|
82
83
|
},
|
83
84
|
"devDependencies": {
|
@@ -86,7 +87,6 @@
|
|
86
87
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
87
88
|
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
88
89
|
"@typescript-eslint/parser": "^5.8.1",
|
89
|
-
"chai": "^4.3.6",
|
90
90
|
"cspell": "^6.17.0",
|
91
91
|
"eslint": "^8.6.0",
|
92
92
|
"eslint-config-prettier": "^8.3.0",
|
@@ -94,12 +94,13 @@
|
|
94
94
|
"eslint-plugin-functional": "^4.0.2",
|
95
95
|
"eslint-plugin-import": "^2.25.3",
|
96
96
|
"eslint-plugin-prettier": "^4.0.0",
|
97
|
-
"fast-check": "^2.14.0",
|
98
97
|
"npm-run-all": "^4.1.5",
|
99
98
|
"prettier": "^2.1.1",
|
100
99
|
"rollup": "^2.75.0",
|
101
100
|
"ts-loader": "^9.4.1",
|
102
|
-
"typescript": "^4.6.3"
|
101
|
+
"typescript": "^4.6.3",
|
102
|
+
"chai": "^4.3.6",
|
103
|
+
"fast-check": "^2.14.0"
|
103
104
|
},
|
104
105
|
"typedoc": {
|
105
106
|
"entryPoint": "./src/index.ts"
|
package/src/ecies.ts
CHANGED
@@ -27,7 +27,7 @@ export { DecodedMessage, generatePrivateKey, getPublicKey };
|
|
27
27
|
|
28
28
|
const log = debug("waku:message-encryption:ecies");
|
29
29
|
|
30
|
-
class Encoder implements IEncoder {
|
30
|
+
export class Encoder implements IEncoder {
|
31
31
|
constructor(
|
32
32
|
public contentTopic: string,
|
33
33
|
private publicKey: Uint8Array,
|
@@ -90,7 +90,7 @@ export function createEncoder(
|
|
90
90
|
return new Encoder(contentTopic, publicKey, sigPrivKey, ephemeral);
|
91
91
|
}
|
92
92
|
|
93
|
-
class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> {
|
93
|
+
export class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> {
|
94
94
|
constructor(contentTopic: string, private privateKey: Uint8Array) {
|
95
95
|
super(contentTopic);
|
96
96
|
}
|
package/src/symmetric.ts
CHANGED
@@ -26,7 +26,7 @@ export { DecodedMessage, generateSymmetricKey };
|
|
26
26
|
|
27
27
|
const log = debug("waku:message-encryption:symmetric");
|
28
28
|
|
29
|
-
class Encoder implements IEncoder {
|
29
|
+
export class Encoder implements IEncoder {
|
30
30
|
constructor(
|
31
31
|
public contentTopic: string,
|
32
32
|
private symKey: Uint8Array,
|
@@ -88,7 +88,7 @@ export function createEncoder(
|
|
88
88
|
return new Encoder(contentTopic, symKey, sigPrivKey, ephemeral);
|
89
89
|
}
|
90
90
|
|
91
|
-
class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> {
|
91
|
+
export class Decoder extends DecoderV0 implements IDecoder<DecodedMessage> {
|
92
92
|
constructor(contentTopic: string, private symKey: Uint8Array) {
|
93
93
|
super(contentTopic);
|
94
94
|
}
|