@open-e2ee/signal-protocol-sdk 0.1.0-alpha.9 → 0.1.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.
Files changed (155) hide show
  1. package/ADAPTERS.md +12 -12
  2. package/ARCHITECTURE.md +3 -3
  3. package/CHANGELOG.md +374 -0
  4. package/README.md +25 -15
  5. package/SECURITY.md +1 -1
  6. package/client/README.md +2 -2
  7. package/device/README.md +3 -1
  8. package/dist/client/client.d.ts +6 -6
  9. package/dist/client/client.js +6 -6
  10. package/dist/client/compose.d.ts +2 -2
  11. package/dist/client/index.d.ts +2 -2
  12. package/dist/device/expo-metadata.d.ts +26 -0
  13. package/dist/device/expo-metadata.d.ts.map +1 -0
  14. package/dist/device/expo-metadata.js +33 -0
  15. package/dist/device/expo-metadata.js.map +1 -0
  16. package/dist/device/index.d.ts +1 -1
  17. package/dist/device/index.d.ts.map +1 -1
  18. package/dist/device/index.js +5 -1
  19. package/dist/device/index.js.map +1 -1
  20. package/dist/device/provisioning.d.ts +4 -12
  21. package/dist/device/provisioning.d.ts.map +1 -1
  22. package/dist/device/provisioning.js +4 -21
  23. package/dist/device/provisioning.js.map +1 -1
  24. package/dist/index.d.ts +5 -5
  25. package/dist/index.js +5 -5
  26. package/dist/internal/crypto/symmetric/aes.d.ts.map +1 -1
  27. package/dist/internal/crypto/symmetric/aes.js +27 -30
  28. package/dist/internal/crypto/symmetric/aes.js.map +1 -1
  29. package/dist/internal/encoding/proto/primitives.d.ts +261 -6
  30. package/dist/internal/encoding/proto/primitives.d.ts.map +1 -1
  31. package/dist/internal/encoding/proto/primitives.js +468 -6
  32. package/dist/internal/encoding/proto/primitives.js.map +1 -1
  33. package/dist/internal/encoding/proto/sender-key-message.d.ts +4 -3
  34. package/dist/internal/encoding/proto/sender-key-message.d.ts.map +1 -1
  35. package/dist/internal/encoding/proto/sender-key-message.js +97 -76
  36. package/dist/internal/encoding/proto/sender-key-message.js.map +1 -1
  37. package/dist/internal/encoding/proto/signal-message.d.ts +7 -2
  38. package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -1
  39. package/dist/internal/encoding/proto/signal-message.js +194 -110
  40. package/dist/internal/encoding/proto/signal-message.js.map +1 -1
  41. package/dist/internal/manager/manager.d.ts +2 -2
  42. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +50 -4
  43. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  44. package/dist/internal/protocol/sealed-sender/proto/index.js +273 -151
  45. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  46. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts +7 -1
  47. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts.map +1 -1
  48. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js +334 -151
  49. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js.map +1 -1
  50. package/dist/layers.d.ts +2 -2
  51. package/dist/layers.d.ts.map +1 -1
  52. package/dist/layers.js +2 -2
  53. package/dist/layers.js.map +1 -1
  54. package/dist/local/store/index.d.ts +3 -3
  55. package/dist/local/store/index.d.ts.map +1 -1
  56. package/dist/local/store/index.js +4 -4
  57. package/dist/local/store/index.js.map +1 -1
  58. package/dist/local/store/{mock → memory}/adapter.d.ts +10 -10
  59. package/dist/local/store/memory/adapter.d.ts.map +1 -0
  60. package/dist/local/store/{mock → memory}/adapter.js +5 -5
  61. package/dist/local/store/memory/adapter.js.map +1 -0
  62. package/dist/local/store/{mock → memory}/failures.d.ts +6 -6
  63. package/dist/local/store/memory/failures.d.ts.map +1 -0
  64. package/dist/local/store/{mock → memory}/failures.js +6 -6
  65. package/dist/local/store/memory/failures.js.map +1 -0
  66. package/dist/local/store/memory/index.d.ts +11 -0
  67. package/dist/local/store/memory/index.d.ts.map +1 -0
  68. package/dist/local/store/memory/index.js +7 -0
  69. package/dist/local/store/memory/index.js.map +1 -0
  70. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  71. package/dist/local/store/react-native/adapter.js +69 -1
  72. package/dist/local/store/react-native/adapter.js.map +1 -1
  73. package/dist/local/store/react-native/backend-conformance.d.ts +66 -0
  74. package/dist/local/store/react-native/backend-conformance.d.ts.map +1 -0
  75. package/dist/local/store/react-native/backend-conformance.js +326 -0
  76. package/dist/local/store/react-native/backend-conformance.js.map +1 -0
  77. package/dist/local/store/react-native/index.d.ts +9 -4
  78. package/dist/local/store/react-native/index.d.ts.map +1 -1
  79. package/dist/local/store/react-native/index.js +2 -0
  80. package/dist/local/store/react-native/index.js.map +1 -1
  81. package/dist/local/store/react-native/reference-backend.d.ts +42 -0
  82. package/dist/local/store/react-native/reference-backend.d.ts.map +1 -0
  83. package/dist/local/store/react-native/reference-backend.js +177 -0
  84. package/dist/local/store/react-native/reference-backend.js.map +1 -0
  85. package/dist/local/store/react-native/storage.d.ts +9 -0
  86. package/dist/local/store/react-native/storage.d.ts.map +1 -1
  87. package/dist/local/store/web/adapter.d.ts +11 -1
  88. package/dist/local/store/web/adapter.d.ts.map +1 -1
  89. package/dist/local/store/web/adapter.js +196 -33
  90. package/dist/local/store/web/adapter.js.map +1 -1
  91. package/dist/local/store/web/index.d.ts +3 -2
  92. package/dist/local/store/web/index.d.ts.map +1 -1
  93. package/dist/local/store/web/index.js.map +1 -1
  94. package/dist/local/vault/index.d.ts +5 -1
  95. package/dist/local/vault/index.d.ts.map +1 -1
  96. package/dist/local/vault/index.js +1 -1
  97. package/dist/local/vault/index.js.map +1 -1
  98. package/dist/remote/relay/convex/component/certificates.d.ts.map +1 -1
  99. package/dist/remote/relay/convex/component/certificates.js +26 -31
  100. package/dist/remote/relay/convex/component/certificates.js.map +1 -1
  101. package/dist/remote/relay/index.d.ts +1 -1
  102. package/dist/remote/relay/index.d.ts.map +1 -1
  103. package/dist/remote/relay/index.js +2 -2
  104. package/dist/remote/relay/index.js.map +1 -1
  105. package/dist/remote/relay/{mock → memory}/adapter.d.ts +17 -17
  106. package/dist/remote/relay/memory/adapter.d.ts.map +1 -0
  107. package/dist/remote/relay/{mock → memory}/adapter.js +17 -17
  108. package/dist/remote/relay/memory/adapter.js.map +1 -0
  109. package/dist/remote/relay/{mock → memory}/failures.d.ts +5 -5
  110. package/dist/remote/relay/memory/failures.d.ts.map +1 -0
  111. package/dist/remote/relay/{mock → memory}/failures.js +1 -1
  112. package/dist/remote/relay/memory/failures.js.map +1 -0
  113. package/dist/remote/relay/{mock → memory}/group-server.d.ts +1 -1
  114. package/dist/remote/relay/memory/group-server.d.ts.map +1 -0
  115. package/dist/remote/relay/{mock → memory}/group-server.js +1 -1
  116. package/dist/remote/relay/memory/group-server.js.map +1 -0
  117. package/dist/remote/relay/memory/index.d.ts +11 -0
  118. package/dist/remote/relay/memory/index.d.ts.map +1 -0
  119. package/dist/remote/relay/memory/index.js +7 -0
  120. package/dist/remote/relay/memory/index.js.map +1 -0
  121. package/dist/types/errors.d.ts +33 -0
  122. package/dist/types/errors.d.ts.map +1 -1
  123. package/dist/types/errors.js +36 -0
  124. package/dist/types/errors.js.map +1 -1
  125. package/docs/ASSURANCE.md +49 -14
  126. package/docs/CLIENT_COMPOSITION.md +3 -3
  127. package/docs/GETTING_STARTED.md +11 -11
  128. package/docs/PACKAGE_SURFACE.md +10 -8
  129. package/docs/RECIPES.md +12 -12
  130. package/local/store/README.md +95 -8
  131. package/local/store/{mock → memory}/README.md +8 -8
  132. package/local/store/react-native/README.md +34 -2
  133. package/local/store/web/README.md +30 -3
  134. package/package.json +13 -10
  135. package/remote/README.md +7 -7
  136. package/remote/relay/README.md +5 -5
  137. package/remote/relay/{mock → memory}/README.md +8 -8
  138. package/dist/local/store/mock/adapter.d.ts.map +0 -1
  139. package/dist/local/store/mock/adapter.js.map +0 -1
  140. package/dist/local/store/mock/failures.d.ts.map +0 -1
  141. package/dist/local/store/mock/failures.js.map +0 -1
  142. package/dist/local/store/mock/index.d.ts +0 -11
  143. package/dist/local/store/mock/index.d.ts.map +0 -1
  144. package/dist/local/store/mock/index.js +0 -7
  145. package/dist/local/store/mock/index.js.map +0 -1
  146. package/dist/remote/relay/mock/adapter.d.ts.map +0 -1
  147. package/dist/remote/relay/mock/adapter.js.map +0 -1
  148. package/dist/remote/relay/mock/failures.d.ts.map +0 -1
  149. package/dist/remote/relay/mock/failures.js.map +0 -1
  150. package/dist/remote/relay/mock/group-server.d.ts.map +0 -1
  151. package/dist/remote/relay/mock/group-server.js.map +0 -1
  152. package/dist/remote/relay/mock/index.d.ts +0 -11
  153. package/dist/remote/relay/mock/index.d.ts.map +0 -1
  154. package/dist/remote/relay/mock/index.js +0 -7
  155. package/dist/remote/relay/mock/index.js.map +0 -1
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * SignalProtocolMessage / PreKeySignalProtocolMessage Protobuf Encoding/Decoding
3
3
  *
4
- * Encodes and decodes SignalProtocolMessage and PreKeySignalProtocolMessage with protobufjs.
4
+ * Hand-written static codecs for SignalProtocolMessage and
5
+ * PreKeySignalProtocolMessage, built on the shared wire primitives.
5
6
  * These are the core message types of the Signal Protocol's Double Ratchet.
6
7
  *
7
8
  * Proto schema:
@@ -40,9 +41,7 @@
40
41
  *
41
42
  * @internal
42
43
  */
43
- import protobuf from 'protobufjs';
44
- import { decodeVarint, encodeVarint } from './primitives.js';
45
- const root = new protobuf.Root();
44
+ import { ProtoReader, concatFields, decodeVarint, encodeBytesField, encodeUint32Field, encodeVarint, } from './primitives.js';
46
45
  // Bound adversarial protobuf work without constraining the documented 10 MiB
47
46
  // message contract. Larger payloads use the separately bounded attachment path.
48
47
  export const MAX_SIGNAL_PROTOCOL_WIRE_MESSAGE_BYTES = 16 * 1024 * 1024;
@@ -52,23 +51,44 @@ function assertWireMessageSize(bytes, label) {
52
51
  }
53
52
  }
54
53
  /**
55
- * SignalProtocolMessage protobuf type.
54
+ * SignalProtocolMessage wire field numbers.
56
55
  *
57
- * Wire fields:
58
56
  * - ratchet_key (1, bytes) - current ratchet public key
59
57
  * - counter (2, uint32) - message number in current chain
60
58
  * - previous_counter (3, uint32) - length of previous sending chain
61
59
  * - ciphertext (4, bytes) - encrypted message content
62
60
  * - pq_ratchet (5, bytes) - opaque SPQR binary data (NOT protobuf)
61
+ * - addresses (6, bytes) - sender/recipient address binding
62
+ * - recipient_identity_type (100, uint32) - SDK extension
63
63
  */
64
- const SignalProtocolMessageType = new protobuf.Type('SignalProtocolMessage')
65
- .add(new protobuf.Field('ratchetKey', 1, 'bytes'))
66
- .add(new protobuf.Field('counter', 2, 'uint32'))
67
- .add(new protobuf.Field('previousCounter', 3, 'uint32'))
68
- .add(new protobuf.Field('ciphertext', 4, 'bytes'))
69
- .add(new protobuf.Field('pqRatchet', 5, 'bytes'))
70
- .add(new protobuf.Field('addresses', 6, 'bytes'))
71
- .add(new protobuf.Field('recipientIdentityType', 100, 'uint32', 'optional'));
64
+ const SIGNAL_MESSAGE_FIELD = {
65
+ ratchetKey: 1,
66
+ counter: 2,
67
+ previousCounter: 3,
68
+ ciphertext: 4,
69
+ pqRatchet: 5,
70
+ addresses: 6,
71
+ recipientIdentityType: 100,
72
+ };
73
+ /**
74
+ * PreKeySignalProtocolMessage wire field numbers.
75
+ *
76
+ * Fields 1-8 are the base PreKeySignalProtocolMessage fields. Fields 100-102
77
+ * are SDK extensions for KEM one-time prekeys and recipient identity scope.
78
+ */
79
+ const PREKEY_MESSAGE_FIELD = {
80
+ oneTimePreKeyId: 1,
81
+ baseKey: 2,
82
+ identityKey: 3,
83
+ message: 4,
84
+ registrationId: 5,
85
+ signedPreKeyId: 6,
86
+ kyberPreKeyId: 7,
87
+ kyberCiphertext: 8,
88
+ kemOneTimePreKeyId: 100,
89
+ kemOneTimeCiphertext: 101,
90
+ recipientIdentityType: 102,
91
+ };
72
92
  const ADDRESS_BINDING_FORMAT_VERSION = 1;
73
93
  function encodeUint32BE(value) {
74
94
  if (!Number.isInteger(value) || value < 0 || value > 0xffffffff) {
@@ -151,33 +171,6 @@ export function signalProtocolMessageAddressesEqual(encoded, senderAddress, reci
151
171
  decoded.recipientAddress.userId === recipientAddress.userId &&
152
172
  decoded.recipientAddress.deviceId === recipientAddress.deviceId);
153
173
  }
154
- /**
155
- * PreKeySignalProtocolMessage protobuf type.
156
- *
157
- * Fields 1-8 are the base PreKeySignalProtocolMessage fields. Fields 100-102 are SDK
158
- * extensions for KEM one-time prekeys and recipient identity scope.
159
- */
160
- const PreKeySignalProtocolMessageType = new protobuf.Type('PreKeySignalProtocolMessage')
161
- // oneTimePreKeyId uses 'optional' rule (proto2 semantics) so that value 0 is
162
- // distinguished from "not set" using proto2 optional presence.
163
- // Without this, protobufjs proto3 default behavior omits 0 on encode and
164
- // makes 0 indistinguishable from absent on decode — breaking X3DH when
165
- // the one-time prekey has keyId=0.
166
- .add(new protobuf.Field('oneTimePreKeyId', 1, 'uint32', 'optional'))
167
- .add(new protobuf.Field('baseKey', 2, 'bytes'))
168
- .add(new protobuf.Field('identityKey', 3, 'bytes'))
169
- .add(new protobuf.Field('message', 4, 'bytes'))
170
- .add(new protobuf.Field('registrationId', 5, 'uint32'))
171
- .add(new protobuf.Field('signedPreKeyId', 6, 'uint32'))
172
- // kyberPreKeyId and kemOneTimePreKeyId also use 'optional' for the same reason
173
- .add(new protobuf.Field('kyberPreKeyId', 7, 'uint32', 'optional'))
174
- .add(new protobuf.Field('kyberCiphertext', 8, 'bytes'))
175
- // Custom extension fields (high field numbers to avoid upstream conflicts)
176
- .add(new protobuf.Field('kemOneTimePreKeyId', 100, 'uint32', 'optional'))
177
- .add(new protobuf.Field('kemOneTimeCiphertext', 101, 'bytes'))
178
- .add(new protobuf.Field('recipientIdentityType', 102, 'uint32', 'optional'));
179
- root.add(SignalProtocolMessageType);
180
- root.add(PreKeySignalProtocolMessageType);
181
174
  /**
182
175
  * Encode a SignalProtocolMessage to protobuf bytes.
183
176
  *
@@ -188,6 +181,11 @@ root.add(PreKeySignalProtocolMessageType);
188
181
  * This produces the **protobuf bytes only** — no version byte or MAC.
189
182
  * Use `frameSignalProtocolMessage()` from `envelope.ts` for the complete wire format.
190
183
  *
184
+ * Presence, not proto3 defaults, decides what reaches the wire: a field the
185
+ * caller set is written even when it equals the type's zero value, so a
186
+ * counter of 0 and a key id of 0 are distinguishable from absent. Fields are
187
+ * written in ascending field-number order.
188
+ *
191
189
  * @param msg - Message fields to encode
192
190
  * @returns Protobuf-encoded bytes (no framing)
193
191
  *
@@ -196,24 +194,32 @@ export function encodeSignalProtocolMessage(msg) {
196
194
  if (!msg.addresses?.length) {
197
195
  throw new Error('SignalProtocolMessage addresses field is required');
198
196
  }
199
- const payload = {
200
- ratchetKey: msg.ratchetKey,
201
- counter: msg.counter,
202
- previousCounter: msg.previousCounter,
203
- ciphertext: msg.ciphertext,
204
- addresses: msg.addresses,
205
- };
197
+ if (msg.recipientIdentityType !== undefined &&
198
+ msg.recipientIdentityType !== 1 &&
199
+ msg.recipientIdentityType !== 2) {
200
+ throw new Error('SignalProtocolMessage recipientIdentityType must be ACI=1 or PNI=2');
201
+ }
202
+ const fields = [];
203
+ if (msg.ratchetKey !== undefined) {
204
+ fields.push(encodeBytesField(SIGNAL_MESSAGE_FIELD.ratchetKey, msg.ratchetKey));
205
+ }
206
+ if (msg.counter !== undefined) {
207
+ fields.push(encodeUint32Field(SIGNAL_MESSAGE_FIELD.counter, msg.counter));
208
+ }
209
+ if (msg.previousCounter !== undefined) {
210
+ fields.push(encodeUint32Field(SIGNAL_MESSAGE_FIELD.previousCounter, msg.previousCounter));
211
+ }
212
+ if (msg.ciphertext !== undefined) {
213
+ fields.push(encodeBytesField(SIGNAL_MESSAGE_FIELD.ciphertext, msg.ciphertext));
214
+ }
206
215
  if (msg.pqRatchet !== undefined) {
207
- payload.pqRatchet = msg.pqRatchet;
216
+ fields.push(encodeBytesField(SIGNAL_MESSAGE_FIELD.pqRatchet, msg.pqRatchet));
208
217
  }
218
+ fields.push(encodeBytesField(SIGNAL_MESSAGE_FIELD.addresses, msg.addresses));
209
219
  if (msg.recipientIdentityType !== undefined) {
210
- if (msg.recipientIdentityType !== 1 && msg.recipientIdentityType !== 2) {
211
- throw new Error('SignalProtocolMessage recipientIdentityType must be ACI=1 or PNI=2');
212
- }
213
- payload.recipientIdentityType = msg.recipientIdentityType;
220
+ fields.push(encodeUint32Field(SIGNAL_MESSAGE_FIELD.recipientIdentityType, msg.recipientIdentityType));
214
221
  }
215
- const message = SignalProtocolMessageType.create(payload);
216
- return new Uint8Array(SignalProtocolMessageType.encode(message).finish());
222
+ return concatFields(...fields);
217
223
  }
218
224
  /**
219
225
  * Decode a SignalProtocolMessage from protobuf bytes.
@@ -227,33 +233,64 @@ export function encodeSignalProtocolMessage(msg) {
227
233
  */
228
234
  export function decodeSignalProtocolMessage(bytes) {
229
235
  assertWireMessageSize(bytes, 'SignalProtocolMessage');
230
- const decoded = SignalProtocolMessageType.decode(bytes);
231
- const message = SignalProtocolMessageType.toObject(decoded, {
232
- defaults: false,
233
- bytes: Uint8Array,
234
- });
235
- if (!message.addresses?.length) {
236
+ let ratchetKey;
237
+ let counter;
238
+ let previousCounter;
239
+ let ciphertext;
240
+ let pqRatchet;
241
+ let addresses;
242
+ let recipientIdentityType;
243
+ const reader = new ProtoReader(bytes);
244
+ while (reader.hasMore()) {
245
+ const { fieldNumber } = reader.readTag();
246
+ switch (fieldNumber) {
247
+ case SIGNAL_MESSAGE_FIELD.ratchetKey:
248
+ ratchetKey = reader.readBytes();
249
+ break;
250
+ case SIGNAL_MESSAGE_FIELD.counter:
251
+ counter = reader.readUint32();
252
+ break;
253
+ case SIGNAL_MESSAGE_FIELD.previousCounter:
254
+ previousCounter = reader.readUint32();
255
+ break;
256
+ case SIGNAL_MESSAGE_FIELD.ciphertext:
257
+ ciphertext = reader.readBytes();
258
+ break;
259
+ case SIGNAL_MESSAGE_FIELD.pqRatchet:
260
+ pqRatchet = reader.readBytes();
261
+ break;
262
+ case SIGNAL_MESSAGE_FIELD.addresses:
263
+ addresses = reader.readBytes();
264
+ break;
265
+ case SIGNAL_MESSAGE_FIELD.recipientIdentityType:
266
+ recipientIdentityType = reader.readUint32();
267
+ break;
268
+ default:
269
+ reader.skipField();
270
+ }
271
+ }
272
+ if (!addresses?.length) {
236
273
  throw new Error('Missing required field: addresses');
237
274
  }
238
- if (message.ratchetKey?.length !== 33) {
275
+ if (ratchetKey?.length !== 33) {
239
276
  throw new Error('SignalProtocolMessage ratchetKey must contain exactly 33 bytes');
240
277
  }
241
- if (!message.ciphertext?.length) {
278
+ if (!ciphertext?.length) {
242
279
  throw new Error('SignalProtocolMessage ciphertext must not be empty');
243
280
  }
244
- if (message.recipientIdentityType !== undefined &&
245
- message.recipientIdentityType !== 1 &&
246
- message.recipientIdentityType !== 2) {
281
+ if (recipientIdentityType !== undefined &&
282
+ recipientIdentityType !== 1 &&
283
+ recipientIdentityType !== 2) {
247
284
  throw new Error('SignalProtocolMessage recipientIdentityType must be ACI=1 or PNI=2');
248
285
  }
249
286
  return {
250
- ratchetKey: new Uint8Array(message.ratchetKey),
251
- counter: message.counter >>> 0,
252
- previousCounter: message.previousCounter >>> 0,
253
- ciphertext: new Uint8Array(message.ciphertext),
254
- pqRatchet: message.pqRatchet?.length ? new Uint8Array(message.pqRatchet) : undefined,
255
- addresses: new Uint8Array(message.addresses),
256
- recipientIdentityType: message.recipientIdentityType,
287
+ ratchetKey,
288
+ counter: counter ?? 0,
289
+ previousCounter: previousCounter ?? 0,
290
+ ciphertext,
291
+ pqRatchet: pqRatchet?.length ? pqRatchet : undefined,
292
+ addresses,
293
+ recipientIdentityType,
257
294
  };
258
295
  }
259
296
  /**
@@ -273,31 +310,43 @@ export function encodePreKeySignalProtocolMessage(msg) {
273
310
  throw new Error('PreKeySignalProtocolMessage recipientIdentityType must be ACI=1 or PNI=2');
274
311
  }
275
312
  // Map TS interface names → proto wire field names
276
- const payload = {
277
- baseKey: msg.baseKey,
278
- identityKey: msg.identityKey,
279
- message: msg.message,
280
- registrationId: msg.registrationId,
281
- signedPreKeyId: msg.ecSignedPreKeyId, // TS ecSignedPreKeyId → wire signedPreKeyId
282
- recipientIdentityType: msg.recipientIdentityType,
283
- };
313
+ const fields = [];
284
314
  if (msg.ecOneTimePreKeyId !== undefined) {
285
- payload.oneTimePreKeyId = msg.ecOneTimePreKeyId; // TS ecOneTimePreKeyId → wire oneTimePreKeyId
315
+ // TS ecOneTimePreKeyId → wire oneTimePreKeyId
316
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.oneTimePreKeyId, msg.ecOneTimePreKeyId));
317
+ }
318
+ if (msg.baseKey !== undefined) {
319
+ fields.push(encodeBytesField(PREKEY_MESSAGE_FIELD.baseKey, msg.baseKey));
320
+ }
321
+ if (msg.identityKey !== undefined) {
322
+ fields.push(encodeBytesField(PREKEY_MESSAGE_FIELD.identityKey, msg.identityKey));
323
+ }
324
+ if (msg.message !== undefined) {
325
+ fields.push(encodeBytesField(PREKEY_MESSAGE_FIELD.message, msg.message));
326
+ }
327
+ if (msg.registrationId !== undefined) {
328
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.registrationId, msg.registrationId));
329
+ }
330
+ if (msg.ecSignedPreKeyId !== undefined) {
331
+ // TS ecSignedPreKeyId → wire signedPreKeyId
332
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.signedPreKeyId, msg.ecSignedPreKeyId));
286
333
  }
287
334
  if (msg.kemLastResortPreKeyId !== undefined) {
288
- payload.kyberPreKeyId = msg.kemLastResortPreKeyId; // TS kemLastResortPreKeyId → wire kyberPreKeyId
335
+ // TS kemLastResortPreKeyId → wire kyberPreKeyId
336
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.kyberPreKeyId, msg.kemLastResortPreKeyId));
289
337
  }
290
338
  if (msg.kemLastResortCiphertext !== undefined) {
291
- payload.kyberCiphertext = msg.kemLastResortCiphertext; // TS kemLastResortCiphertext → wire kyberCiphertext
339
+ // TS kemLastResortCiphertext → wire kyberCiphertext
340
+ fields.push(encodeBytesField(PREKEY_MESSAGE_FIELD.kyberCiphertext, msg.kemLastResortCiphertext));
292
341
  }
293
342
  if (msg.kemOneTimePreKeyId !== undefined) {
294
- payload.kemOneTimePreKeyId = msg.kemOneTimePreKeyId;
343
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.kemOneTimePreKeyId, msg.kemOneTimePreKeyId));
295
344
  }
296
345
  if (msg.kemOneTimeCiphertext !== undefined) {
297
- payload.kemOneTimeCiphertext = msg.kemOneTimeCiphertext;
346
+ fields.push(encodeBytesField(PREKEY_MESSAGE_FIELD.kemOneTimeCiphertext, msg.kemOneTimeCiphertext));
298
347
  }
299
- const message = PreKeySignalProtocolMessageType.create(payload);
300
- return new Uint8Array(PreKeySignalProtocolMessageType.encode(message).finish());
348
+ fields.push(encodeUint32Field(PREKEY_MESSAGE_FIELD.recipientIdentityType, msg.recipientIdentityType));
349
+ return concatFields(...fields);
301
350
  }
302
351
  /**
303
352
  * Decode a PreKeySignalProtocolMessage from protobuf bytes.
@@ -311,15 +360,51 @@ export function encodePreKeySignalProtocolMessage(msg) {
311
360
  */
312
361
  export function decodePreKeySignalProtocolMessage(bytes) {
313
362
  assertWireMessageSize(bytes, 'PreKeySignalProtocolMessage');
314
- const decoded = PreKeySignalProtocolMessageType.decode(bytes);
315
- // Use toObject with defaults:false so that absent optional fields are omitted
316
- // (undefined) while present fields retain their value — including 0.
317
- // Proto2 optional presence makes value 0 a valid key ID, distinct
318
- // from "field not set".
319
- const wireMessage = PreKeySignalProtocolMessageType.toObject(decoded, {
320
- defaults: false,
321
- bytes: Uint8Array,
322
- });
363
+ // Every field is tracked by presence, so an absent field stays undefined
364
+ // while a present one keeps its value — including 0. Proto2 optional
365
+ // presence makes value 0 a valid key ID, distinct from "field not set".
366
+ const wireMessage = {};
367
+ const reader = new ProtoReader(bytes);
368
+ while (reader.hasMore()) {
369
+ const { fieldNumber } = reader.readTag();
370
+ switch (fieldNumber) {
371
+ case PREKEY_MESSAGE_FIELD.oneTimePreKeyId:
372
+ wireMessage.oneTimePreKeyId = reader.readUint32();
373
+ break;
374
+ case PREKEY_MESSAGE_FIELD.baseKey:
375
+ wireMessage.baseKey = reader.readBytes();
376
+ break;
377
+ case PREKEY_MESSAGE_FIELD.identityKey:
378
+ wireMessage.identityKey = reader.readBytes();
379
+ break;
380
+ case PREKEY_MESSAGE_FIELD.message:
381
+ wireMessage.message = reader.readBytes();
382
+ break;
383
+ case PREKEY_MESSAGE_FIELD.registrationId:
384
+ wireMessage.registrationId = reader.readUint32();
385
+ break;
386
+ case PREKEY_MESSAGE_FIELD.signedPreKeyId:
387
+ wireMessage.signedPreKeyId = reader.readUint32();
388
+ break;
389
+ case PREKEY_MESSAGE_FIELD.kyberPreKeyId:
390
+ wireMessage.kyberPreKeyId = reader.readUint32();
391
+ break;
392
+ case PREKEY_MESSAGE_FIELD.kyberCiphertext:
393
+ wireMessage.kyberCiphertext = reader.readBytes();
394
+ break;
395
+ case PREKEY_MESSAGE_FIELD.kemOneTimePreKeyId:
396
+ wireMessage.kemOneTimePreKeyId = reader.readUint32();
397
+ break;
398
+ case PREKEY_MESSAGE_FIELD.kemOneTimeCiphertext:
399
+ wireMessage.kemOneTimeCiphertext = reader.readBytes();
400
+ break;
401
+ case PREKEY_MESSAGE_FIELD.recipientIdentityType:
402
+ wireMessage.recipientIdentityType = reader.readUint32();
403
+ break;
404
+ default:
405
+ reader.skipField();
406
+ }
407
+ }
323
408
  if (wireMessage.baseKey?.length !== 33) {
324
409
  throw new Error('PreKeySignalProtocolMessage baseKey must contain exactly 33 bytes');
325
410
  }
@@ -341,31 +426,30 @@ export function decodePreKeySignalProtocolMessage(bytes) {
341
426
  }
342
427
  // Map proto wire names → TS interface names
343
428
  const result = {
344
- baseKey: new Uint8Array(wireMessage.baseKey),
345
- identityKey: new Uint8Array(wireMessage.identityKey),
346
- message: new Uint8Array(wireMessage.message),
347
- registrationId: wireMessage.registrationId >>> 0,
348
- ecSignedPreKeyId: wireMessage.signedPreKeyId >>> 0, // wire signedPreKeyId → TS ecSignedPreKeyId
429
+ baseKey: wireMessage.baseKey,
430
+ identityKey: wireMessage.identityKey,
431
+ message: wireMessage.message,
432
+ registrationId: wireMessage.registrationId,
433
+ ecSignedPreKeyId: wireMessage.signedPreKeyId, // wire signedPreKeyId → TS ecSignedPreKeyId
349
434
  recipientIdentityType: wireMessage.recipientIdentityType,
350
435
  };
351
- // Optional fields: with toObject({defaults:false}), absent fields are undefined
352
- // and present fields have their value (including 0), preserving proto2
353
- // optional-field semantics.
436
+ // Optional fields: an absent field is undefined and a present one has its
437
+ // value (including 0), preserving proto2 optional-field semantics.
354
438
  if (wireMessage.oneTimePreKeyId !== undefined) {
355
- result.ecOneTimePreKeyId = wireMessage.oneTimePreKeyId >>> 0; // wire oneTimePreKeyId → TS ecOneTimePreKeyId
439
+ result.ecOneTimePreKeyId = wireMessage.oneTimePreKeyId; // wire oneTimePreKeyId → TS ecOneTimePreKeyId
356
440
  }
357
441
  if (wireMessage.kyberPreKeyId !== undefined) {
358
- result.kemLastResortPreKeyId = wireMessage.kyberPreKeyId >>> 0; // wire kyberPreKeyId → TS kemLastResortPreKeyId
442
+ result.kemLastResortPreKeyId = wireMessage.kyberPreKeyId; // wire kyberPreKeyId → TS kemLastResortPreKeyId
359
443
  }
360
444
  if (wireMessage.kyberCiphertext?.length) {
361
- result.kemLastResortCiphertext = new Uint8Array(wireMessage.kyberCiphertext); // wire kyberCiphertext → TS kemLastResortCiphertext
445
+ result.kemLastResortCiphertext = wireMessage.kyberCiphertext; // wire kyberCiphertext → TS kemLastResortCiphertext
362
446
  }
363
447
  // Optional custom extension fields (100-101) — already use correct names
364
448
  if (wireMessage.kemOneTimePreKeyId !== undefined) {
365
- result.kemOneTimePreKeyId = wireMessage.kemOneTimePreKeyId >>> 0;
449
+ result.kemOneTimePreKeyId = wireMessage.kemOneTimePreKeyId;
366
450
  }
367
451
  if (wireMessage.kemOneTimeCiphertext?.length) {
368
- result.kemOneTimeCiphertext = new Uint8Array(wireMessage.kemOneTimeCiphertext);
452
+ result.kemOneTimeCiphertext = wireMessage.kemOneTimeCiphertext;
369
453
  }
370
454
  return result;
371
455
  }
@@ -1 +1 @@
1
- {"version":3,"file":"signal-message.js","sourceRoot":"","sources":["../../../../internal/encoding/proto/signal-message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAM1D,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;AACjC,6EAA6E;AAC7E,gFAAgF;AAChF,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvE,SAAS,qBAAqB,CAAC,KAAiB,EAAE,KAAa;IAC7D,IAAI,KAAK,CAAC,MAAM,GAAG,sCAAsC,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,YAAY,sCAAsC,mBAAmB,CAAC,CAAC;IACjG,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,yBAAyB,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,uBAAuB,CAAC;KACzE,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;KACjD,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;KAC/C,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;KACvD,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;KACjD,GAAG,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;KAChD,GAAG,CAAC,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AI,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,oDAAoD;IACpI,CAAC;IAED,yEAAyE;IACzE,IAAI,WAAW,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACjD,MAAM,CAAC,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,KAAK,CAAC,CAAC;IACnE,CAAC;IACD,IAAI,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,CAAC;QAC7C,MAAM,CAAC,oBAAoB,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"signal-message.js","sourceRoot":"","sources":["../../../../internal/encoding/proto/signal-message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,cAAc,CAAC;AAMtB,6EAA6E;AAC7E,gFAAgF;AAChF,MAAM,CAAC,MAAM,sCAAsC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvE,SAAS,qBAAqB,CAAC,KAAiB,EAAE,KAAa;IAC7D,IAAI,KAAK,CAAC,MAAM,GAAG,sCAAsC,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,YAAY,sCAAsC,mBAAmB,CAAC,CAAC;IACjG,CAAC;AACH,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,oBAAoB,GAAG;IAC3B,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,CAAC;IACV,eAAe,EAAE,CAAC;IAClB,UAAU,EAAE,CAAC;IACb,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,CAAC;IACZ,qBAAqB,EAAE,GAAG;CAClB,CAAC;AAEX;;;;;GAKG;AACH,MAA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qBAAqB,KAAK,CAAC,EACvC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;IAC9F,CAAC;IAED,4CAA4C;IAC5C,MAAM,MAAM,GAAsC;QAChD,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,WAAW,EAAE,WAAW,CAAC,WAAW;QACpC,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,cAAc,EAAE,WAAW,CAAC,cAAc;QAC1C,gBAAgB,EAAE,WAAW,CAAC,cAAc,EAAE,4CAA4C;QAC1F,qBAAqB,EAAE,WAAW,CAAC,qBAAqB;KACzD,CAAC;IAEF,0EAA0E;IAC1E,mEAAmE;IACnE,IAAI,WAAW,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QAC9C,MAAM,CAAC,iBAAiB,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC,8CAA8C;IACxG,CAAC;IACD,IAAI,WAAW,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QAC5C,MAAM,CAAC,qBAAqB,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC,gDAAgD;IAC5G,CAAC;IACD,IAAI,WAAW,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;QACxC,MAAM,CAAC,uBAAuB,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC,oDAAoD;IACpH,CAAC;IAED,yEAAyE;IACzE,IAAI,WAAW,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACjD,MAAM,CAAC,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC;IAC7D,CAAC;IACD,IAAI,WAAW,CAAC,oBAAoB,EAAE,MAAM,EAAE,CAAC;QAC7C,MAAM,CAAC,oBAAoB,GAAG,WAAW,CAAC,oBAAoB,CAAC;IACjE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -79,8 +79,8 @@ import type { IdentityType } from '../../keys/types.js';
79
79
  *
80
80
  * @example Dependency injection for custom composition
81
81
  * ```typescript
82
- * const mockStorage = new MockSignalProtocolStore();
83
- * const manager = new SignalProtocolManager(mockStorage);
82
+ * const store = new InMemorySignalProtocolStore();
83
+ * const manager = new SignalProtocolManager(store);
84
84
  * await manager.initialize();
85
85
  * ```
86
86
  *
@@ -1,10 +1,29 @@
1
1
  /**
2
- * Protocol Buffer Bindings for Sealed Sender
2
+ * Wire Codec for Sealed Sender
3
3
  *
4
- * TypeScript bindings for the sealed sender wire format.
5
- * Uses protobufjs for encoding/decoding.
4
+ * Hand-written static encoders and decoders for the sealed sender wire format,
5
+ * built on the shared protobuf primitives. No code is generated at runtime, so
6
+ * this path runs under `script-src 'self'`, in a Chrome MV3 extension, and
7
+ * under `node --disallow-code-generation-from-strings`.
6
8
  *
7
- * Field numbers follow the sealed-sender wire format.
9
+ * Certificates are signed over their *serialized* inner bytes, so byte
10
+ * identity here is what keeps an already-issued certificate verifiable. Two
11
+ * consequences run through the whole module:
12
+ *
13
+ * - Nothing re-encodes a signed region. Wherever the surface carries a signed
14
+ * payload it carries the raw bytes the signer saw — `certificate` in either
15
+ * wrapper, and `signerCertificate` inside the sender certificate — and the
16
+ * decoders hand those bytes straight through.
17
+ * - The encoders reproduce what this module emitted before, field for field
18
+ * and byte for byte, including writing an explicitly-set zero. The
19
+ * `sealed-sender` golden vectors pin every case in both directions. One
20
+ * input diverges: a string holding an unpaired surrogate encodes to the
21
+ * replacement character here, where reflection emitted the surrogate's own
22
+ * three bytes. `senderE164` and `senderUuid` are the only string fields,
23
+ * and no verification path re-encodes either.
24
+ *
25
+ * Field numbers are those this format has always written, and
26
+ * `UnidentifiedDelivery.proto` alongside this file now records them.
8
27
  */
9
28
  import type { Base64 } from '../../../../types/index.js';
10
29
  import { SealedSenderContentType } from '../types.js';
@@ -68,6 +87,8 @@ export interface UnidentifiedSenderMessageProto {
68
87
  }
69
88
  /**
70
89
  * Encode server certificate inner Certificate data to protobuf bytes.
90
+ *
91
+ * These are the bytes the trust root signs.
71
92
  */
72
93
  export declare function encodeServerCertificateData(data: ServerCertificateData): Uint8Array;
73
94
  /**
@@ -80,17 +101,26 @@ export declare function decodeServerCertificateData(bytes: Uint8Array): ServerCe
80
101
  export declare function encodeServerCertificate(cert: ServerCertificateProto): Uint8Array;
81
102
  /**
82
103
  * Decode server certificate outer wrapper from protobuf bytes.
104
+ *
105
+ * `certificate` is returned exactly as it arrived — it is the byte string the
106
+ * signature was computed over.
83
107
  */
84
108
  export declare function decodeServerCertificate(bytes: Uint8Array): ServerCertificateProto;
85
109
  /**
86
110
  * Encode sender certificate inner Certificate data to protobuf bytes.
87
111
  * Field numbers are part of the sealed-sender wire format.
88
112
  *
113
+ * These are the bytes the issuing server signs. Fields are written in field
114
+ * number order; `senderE164` is written only when the sender has one, which is
115
+ * the one field a certificate may legitimately omit.
89
116
  */
90
117
  export declare function encodeSenderCertificateData(data: SenderCertificateData): Uint8Array;
91
118
  /**
92
119
  * Decode sender certificate inner Certificate data from protobuf bytes.
93
120
  *
121
+ * `signerCertificate` is the serialized `ServerCertificate` and is returned
122
+ * unmodified: the sender certificate's signature covers these bytes, so
123
+ * re-encoding it here would invalidate certificates that are currently valid.
94
124
  */
95
125
  export declare function decodeSenderCertificateData(bytes: Uint8Array): SenderCertificateData;
96
126
  /**
@@ -99,14 +129,30 @@ export declare function decodeSenderCertificateData(bytes: Uint8Array): SenderCe
99
129
  export declare function encodeSenderCertificate(cert: SenderCertificateProto): Uint8Array;
100
130
  /**
101
131
  * Decode sender certificate outer wrapper from protobuf bytes.
132
+ *
133
+ * `certificate` is returned exactly as it arrived — it is the byte string the
134
+ * signature was computed over.
102
135
  */
103
136
  export declare function decodeSenderCertificate(bytes: Uint8Array): SenderCertificateProto;
104
137
  /**
105
138
  * Encode inner message data to bytes.
139
+ *
140
+ * `contentHint` is written whenever it is set, zero included — an absent hint
141
+ * and a hint of zero are different statements. `groupId` follows the same rule.
106
142
  */
107
143
  export declare function encodeUnidentifiedSenderMessageData(data: UnidentifiedSenderMessageData): Uint8Array;
108
144
  /**
109
145
  * Decode inner message data from bytes.
146
+ *
147
+ * `type` is returned as it arrived — 0 when the field is absent, and any
148
+ * other value the wire carried, declared by the enum or not. Reflection
149
+ * clamped every undeclared value to the enum's first arm, so both an absent
150
+ * type and a type from a newer peer were reported as `PREKEY_MESSAGE`, which
151
+ * the sender never wrote; preserving the value is also what the protobuf spec
152
+ * asks of a decoder. The return type names the enum but nothing here narrows
153
+ * to it, so a caller that routes on `type` must put it through
154
+ * `isSealedSenderContentType` first. Neither decrypt path does today — both
155
+ * read the content type from the envelope framing, not from this decoder.
110
156
  */
111
157
  export declare function decodeUnidentifiedSenderMessageData(bytes: Uint8Array): UnidentifiedSenderMessageData;
112
158
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/sealed-sender/proto/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAOnD;;GAEG;AACH,OAAO,EAAE,CAAC;AACV,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,UAAU,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,UAAU,CAAC;IACxB,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,UAAU,CAAC;IACxB,iBAAiB,EAAE,UAAU,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,UAAU,CAAC;IACxB,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;;;;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BAAgB,+BAA+B,CAAC,GAAG,EAAE,8BAA8B,GAAG,UAAU,CAO/F;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,UAAU,GAAG,8BAA8B,CAYjG;AAMD;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEvD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAExD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../internal/protocol/sealed-sender/proto/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAsBnD;;GAEG;AACH,OAAO,EAAE,CAAC;AACV,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,UAAU,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,UAAU,CAAC;IACxB,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,UAAU,CAAC;IACxB,iBAAiB,EAAE,UAAU,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,UAAU,CAAC;IACxB,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;;;;GAKG;AACH,OAAO,EAAE,uBAAuB,IAAI,WAAW,EAAE,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,uBAAuB,C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