@waku/message-encryption 0.0.35-c7fe44e.0 → 0.0.36-3545a8e.0
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 +12 -0
- package/bundle/crypto.js +1 -1
- package/bundle/{ecies-SoJnlQ4a.js → ecies-HdUXyKbi.js} +15 -11
- package/bundle/ecies.js +3 -3
- package/bundle/{encryption-D_9ex828.js → encryption-DCdb0Qpb.js} +169 -560
- package/bundle/{index-uHWNcEd0.js → index-BVMnprgl.js} +1 -1
- package/bundle/index.js +5 -5
- package/bundle/{symmetric-DPlNQ4aL.js → symmetric-B5XVN0Wd.js} +1 -5
- package/bundle/{symmetric-CIP2vKQ6.js → symmetric-_y7uWU-v.js} +15 -11
- package/bundle/symmetric.js +3 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/ecies.d.ts +8 -10
- package/dist/ecies.js +14 -10
- package/dist/ecies.js.map +1 -1
- package/dist/symmetric.d.ts +8 -6
- package/dist/symmetric.js +14 -10
- package/dist/symmetric.js.map +1 -1
- package/package.json +1 -1
- package/src/ecies.ts +16 -20
- package/src/symmetric.ts +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -101,6 +101,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
101
101
|
* @waku/interfaces bumped from 0.0.27 to 0.0.28
|
|
102
102
|
* @waku/utils bumped from 0.0.20 to 0.0.21
|
|
103
103
|
|
|
104
|
+
## [0.0.35](https://github.com/waku-org/js-waku/compare/message-encryption-v0.0.34...message-encryption-v0.0.35) (2025-07-18)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
### Dependencies
|
|
108
|
+
|
|
109
|
+
* The following workspace dependencies were updated
|
|
110
|
+
* dependencies
|
|
111
|
+
* @waku/core bumped from 0.0.36 to 0.0.37
|
|
112
|
+
* @waku/interfaces bumped from 0.0.31 to 0.0.32
|
|
113
|
+
* @waku/proto bumped from 0.0.11 to 0.0.12
|
|
114
|
+
* @waku/utils bumped from 0.0.24 to 0.0.25
|
|
115
|
+
|
|
104
116
|
## [0.0.34](https://github.com/waku-org/js-waku/compare/message-encryption-v0.0.33...message-encryption-v0.0.34) (2025-06-23)
|
|
105
117
|
|
|
106
118
|
|
package/bundle/crypto.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { e as ecies, g as generatePrivateKey, a as generateSymmetricKey, b as getPublicKey, c as getSubtle, k as keccak256, r as randomBytes, s as sha256, d as sign, f as symmetric } from './symmetric-
|
|
1
|
+
export { e as ecies, g as generatePrivateKey, a as generateSymmetricKey, b as getPublicKey, c as getSubtle, k as keccak256, r as randomBytes, s as sha256, d as sign, f as symmetric } from './symmetric-B5XVN0Wd.js';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { L as Logger,
|
|
2
|
-
import { O as OneMillion, V as Version, g as generatePrivateKey } from './symmetric-
|
|
1
|
+
import { L as Logger, W as WakuMessage, p as preCipher, e as encryptAsymmetric, D as Decoder$1, d as decryptAsymmetric, a as postCipher, b as DecodedMessage } from './encryption-DCdb0Qpb.js';
|
|
2
|
+
import { O as OneMillion, V as Version, g as generatePrivateKey } from './symmetric-B5XVN0Wd.js';
|
|
3
3
|
|
|
4
4
|
const log = new Logger("message-encryption:ecies");
|
|
5
5
|
class Encoder {
|
|
6
|
-
pubsubTopic;
|
|
7
6
|
contentTopic;
|
|
7
|
+
routingInfo;
|
|
8
8
|
publicKey;
|
|
9
9
|
sigPrivKey;
|
|
10
10
|
ephemeral;
|
|
11
11
|
metaSetter;
|
|
12
|
-
constructor(
|
|
13
|
-
this.pubsubTopic = pubsubTopic;
|
|
12
|
+
constructor(contentTopic, routingInfo, publicKey, sigPrivKey, ephemeral = false, metaSetter) {
|
|
14
13
|
this.contentTopic = contentTopic;
|
|
14
|
+
this.routingInfo = routingInfo;
|
|
15
15
|
this.publicKey = publicKey;
|
|
16
16
|
this.sigPrivKey = sigPrivKey;
|
|
17
17
|
this.ephemeral = ephemeral;
|
|
@@ -20,6 +20,9 @@ class Encoder {
|
|
|
20
20
|
throw new Error("Content topic must be specified");
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
get pubsubTopic() {
|
|
24
|
+
return this.routingInfo.pubsubTopic;
|
|
25
|
+
}
|
|
23
26
|
async toWire(message) {
|
|
24
27
|
const protoMessage = await this.toProtoObj(message);
|
|
25
28
|
if (!protoMessage)
|
|
@@ -58,13 +61,13 @@ class Encoder {
|
|
|
58
61
|
* The payload can optionally be signed with the given private key as defined
|
|
59
62
|
* in [26/WAKU2-PAYLOAD](https://rfc.vac.dev/spec/26/).
|
|
60
63
|
*/
|
|
61
|
-
function createEncoder({
|
|
62
|
-
return new Encoder(
|
|
64
|
+
function createEncoder({ contentTopic, routingInfo, publicKey, sigPrivKey, ephemeral = false, metaSetter }) {
|
|
65
|
+
return new Encoder(contentTopic, routingInfo, publicKey, sigPrivKey, ephemeral, metaSetter);
|
|
63
66
|
}
|
|
64
67
|
class Decoder extends Decoder$1 {
|
|
65
68
|
privateKey;
|
|
66
|
-
constructor(
|
|
67
|
-
super(
|
|
69
|
+
constructor(contentTopic, routingInfo, privateKey) {
|
|
70
|
+
super(contentTopic, routingInfo);
|
|
68
71
|
this.privateKey = privateKey;
|
|
69
72
|
}
|
|
70
73
|
async fromProtoObj(pubsubTopic, protoMessage) {
|
|
@@ -104,10 +107,11 @@ class Decoder extends Decoder$1 {
|
|
|
104
107
|
* decode incoming messages.
|
|
105
108
|
*
|
|
106
109
|
* @param contentTopic The resulting decoder will only decode messages with this content topic.
|
|
110
|
+
* @param routingInfo
|
|
107
111
|
* @param privateKey The private key used to decrypt the message.
|
|
108
112
|
*/
|
|
109
|
-
function createDecoder(contentTopic,
|
|
110
|
-
return new Decoder(
|
|
113
|
+
function createDecoder(contentTopic, routingInfo, privateKey) {
|
|
114
|
+
return new Decoder(contentTopic, routingInfo, privateKey);
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
var ecies = /*#__PURE__*/Object.freeze({
|
package/bundle/ecies.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { g as generatePrivateKey } from './symmetric-
|
|
3
|
-
export { a as createDecoder, c as createEncoder } from './ecies-
|
|
1
|
+
export { d as decryptAsymmetric, e as encryptAsymmetric, a as postCipher, p as preCipher } from './encryption-DCdb0Qpb.js';
|
|
2
|
+
export { g as generatePrivateKey } from './symmetric-B5XVN0Wd.js';
|
|
3
|
+
export { a as createDecoder, c as createEncoder } from './ecies-HdUXyKbi.js';
|