@neykoor/libsignal-node 1.0.3 → 1.0.6

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 (86) hide show
  1. package/README.md +28 -41
  2. package/lib/base-key-type.d.ts +1 -0
  3. package/lib/base-key-type.d.ts.map +1 -0
  4. package/lib/base-key-type.js +1 -0
  5. package/lib/base-key-type.js.map +1 -0
  6. package/lib/chain-type.d.ts +1 -0
  7. package/lib/chain-type.d.ts.map +1 -0
  8. package/lib/chain-type.js +1 -0
  9. package/lib/chain-type.js.map +1 -0
  10. package/lib/crypto.d.ts +1 -0
  11. package/lib/crypto.d.ts.map +1 -0
  12. package/lib/crypto.js +10 -9
  13. package/lib/crypto.js.map +1 -0
  14. package/lib/curve.d.ts +1 -0
  15. package/lib/curve.d.ts.map +1 -0
  16. package/lib/curve.js +20 -19
  17. package/lib/curve.js.map +1 -0
  18. package/lib/direction.d.ts +1 -0
  19. package/lib/direction.d.ts.map +1 -0
  20. package/lib/direction.js +1 -0
  21. package/lib/direction.js.map +1 -0
  22. package/lib/errors.d.ts +1 -0
  23. package/lib/errors.d.ts.map +1 -0
  24. package/lib/errors.js +6 -5
  25. package/lib/errors.js.map +1 -0
  26. package/lib/index.d.ts +21 -20
  27. package/lib/index.d.ts.map +1 -0
  28. package/lib/index.js +17 -16
  29. package/lib/index.js.map +1 -0
  30. package/lib/keyhelper.d.ts +3 -2
  31. package/lib/keyhelper.d.ts.map +1 -0
  32. package/lib/keyhelper.js +9 -8
  33. package/lib/keyhelper.js.map +1 -0
  34. package/lib/logger.d.ts +1 -0
  35. package/lib/logger.d.ts.map +1 -0
  36. package/lib/logger.js +1 -0
  37. package/lib/logger.js.map +1 -0
  38. package/lib/memory-storage.d.ts +5 -4
  39. package/lib/memory-storage.d.ts.map +1 -0
  40. package/lib/memory-storage.js +3 -2
  41. package/lib/memory-storage.js.map +1 -0
  42. package/lib/numeric-fingerprint.d.ts +1 -0
  43. package/lib/numeric-fingerprint.d.ts.map +1 -0
  44. package/lib/numeric-fingerprint.js +7 -6
  45. package/lib/numeric-fingerprint.js.map +1 -0
  46. package/lib/prekey-bundle-validator.d.ts +2 -1
  47. package/lib/prekey-bundle-validator.d.ts.map +1 -0
  48. package/lib/prekey-bundle-validator.js +13 -12
  49. package/lib/prekey-bundle-validator.js.map +1 -0
  50. package/lib/protobufs.d.ts +2 -1
  51. package/lib/protobufs.d.ts.map +1 -0
  52. package/lib/protobufs.js +2 -1
  53. package/lib/protobufs.js.map +1 -0
  54. package/lib/protocol-address.d.ts +1 -0
  55. package/lib/protocol-address.d.ts.map +1 -0
  56. package/lib/protocol-address.js +19 -10
  57. package/lib/protocol-address.js.map +1 -0
  58. package/lib/queue-job.d.ts +1 -0
  59. package/lib/queue-job.d.ts.map +1 -0
  60. package/lib/queue-job.js +1 -7
  61. package/lib/queue-job.js.map +1 -0
  62. package/lib/session-builder.d.ts +4 -3
  63. package/lib/session-builder.d.ts.map +1 -0
  64. package/lib/session-builder.js +17 -16
  65. package/lib/session-builder.js.map +1 -0
  66. package/lib/session-cipher.d.ts +5 -4
  67. package/lib/session-cipher.d.ts.map +1 -0
  68. package/lib/session-cipher.js +37 -36
  69. package/lib/session-cipher.js.map +1 -0
  70. package/lib/session-record.d.ts +6 -2
  71. package/lib/session-record.d.ts.map +1 -0
  72. package/lib/session-record.js +62 -39
  73. package/lib/session-record.js.map +1 -0
  74. package/lib/types.d.ts +4 -3
  75. package/lib/types.d.ts.map +1 -0
  76. package/lib/types.js +1 -0
  77. package/lib/types.js.map +1 -0
  78. package/lib/util.d.ts +1 -0
  79. package/lib/util.d.ts.map +1 -0
  80. package/lib/util.js +1 -0
  81. package/lib/util.js.map +1 -0
  82. package/lib/whisper-text-protocol.d.ts +85 -2
  83. package/lib/whisper-text-protocol.d.ts.map +1 -0
  84. package/lib/whisper-text-protocol.js +375 -335
  85. package/lib/whisper-text-protocol.js.map +1 -0
  86. package/package.json +46 -36
@@ -1,483 +1,523 @@
1
- import $protobuf from 'protobufjs/minimal.js';
2
- var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
3
- var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
4
- $root.textsecure = (function () {
5
- var textsecure = {};
6
- textsecure.WhisperMessage = (function () {
7
- function WhisperMessage(properties) {
8
- if (properties)
9
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
10
- if (properties[keys[i]] != null)
11
- this[keys[i]] = properties[keys[i]];
1
+ import $protobuf from "protobufjs/minimal.js";
2
+ const $Reader = $protobuf.Reader;
3
+ const $Writer = $protobuf.Writer;
4
+ const $util = $protobuf.util;
5
+ export var textsecure;
6
+ (function (textsecure) {
7
+ class WhisperMessage {
8
+ constructor(properties) {
9
+ if (properties) {
10
+ for (const key of Object.keys(properties)) {
11
+ const value = properties[key];
12
+ if (value != null)
13
+ this[key] = value;
14
+ }
15
+ }
12
16
  }
13
- WhisperMessage.prototype.ephemeralKey = $util.newBuffer([]);
14
- WhisperMessage.prototype.counter = 0;
15
- WhisperMessage.prototype.previousCounter = 0;
16
- WhisperMessage.prototype.ciphertext = $util.newBuffer([]);
17
- WhisperMessage.create = function create(properties) {
17
+ static create(properties) {
18
18
  return new WhisperMessage(properties);
19
- };
20
- WhisperMessage.encode = function encode(message, writer) {
19
+ }
20
+ static encode(message, writer) {
21
21
  if (!writer)
22
22
  writer = $Writer.create();
23
- if (message.ephemeralKey != null && message.hasOwnProperty("ephemeralKey"))
23
+ const own = message;
24
+ if (message.ephemeralKey != null && Object.prototype.hasOwnProperty.call(own, "ephemeralKey"))
24
25
  writer.uint32(10).bytes(message.ephemeralKey);
25
- if (message.counter != null && message.hasOwnProperty("counter"))
26
+ if (message.counter != null && Object.prototype.hasOwnProperty.call(own, "counter"))
26
27
  writer.uint32(16).uint32(message.counter);
27
- if (message.previousCounter != null && message.hasOwnProperty("previousCounter"))
28
+ if (message.previousCounter != null && Object.prototype.hasOwnProperty.call(own, "previousCounter"))
28
29
  writer.uint32(24).uint32(message.previousCounter);
29
- if (message.ciphertext != null && message.hasOwnProperty("ciphertext"))
30
+ if (message.ciphertext != null && Object.prototype.hasOwnProperty.call(own, "ciphertext"))
30
31
  writer.uint32(34).bytes(message.ciphertext);
31
32
  return writer;
32
- };
33
- WhisperMessage.encodeDelimited = function encodeDelimited(message, writer) {
34
- return this.encode(message, writer).ldelim();
35
- };
36
- WhisperMessage.decode = function decode(reader, length) {
37
- if (!(reader instanceof $Reader))
38
- reader = $Reader.create(reader);
39
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.textsecure.WhisperMessage();
40
- while (reader.pos < end) {
41
- var tag = reader.uint32();
33
+ }
34
+ static encodeDelimited(message, writer) {
35
+ return WhisperMessage.encode(message, writer).ldelim();
36
+ }
37
+ static decode(reader, length) {
38
+ const r = reader instanceof $Reader ? reader : $Reader.create(reader);
39
+ const end = length === undefined ? r.len : r.pos + length;
40
+ const message = new WhisperMessage();
41
+ while (r.pos < end) {
42
+ const tag = r.uint32();
42
43
  switch (tag >>> 3) {
43
44
  case 1:
44
- message.ephemeralKey = reader.bytes();
45
+ message.ephemeralKey = r.bytes();
45
46
  break;
46
47
  case 2:
47
- message.counter = reader.uint32();
48
+ message.counter = r.uint32();
48
49
  break;
49
50
  case 3:
50
- message.previousCounter = reader.uint32();
51
+ message.previousCounter = r.uint32();
51
52
  break;
52
53
  case 4:
53
- message.ciphertext = reader.bytes();
54
+ message.ciphertext = r.bytes();
54
55
  break;
55
56
  default:
56
- reader.skipType(tag & 7);
57
+ r.skipType(tag & 7);
57
58
  break;
58
59
  }
59
60
  }
60
61
  return message;
61
- };
62
- WhisperMessage.decodeDelimited = function decodeDelimited(reader) {
63
- if (!(reader instanceof $Reader))
64
- reader = new $Reader(reader);
65
- return this.decode(reader, reader.uint32());
66
- };
67
- WhisperMessage.verify = function verify(message) {
62
+ }
63
+ static decodeDelimited(reader) {
64
+ const r = reader instanceof $Reader ? reader : new $Reader(reader);
65
+ return WhisperMessage.decode(r, r.uint32());
66
+ }
67
+ static verify(message) {
68
68
  if (typeof message !== "object" || message === null)
69
69
  return "object expected";
70
- if (message.ephemeralKey != null && message.hasOwnProperty("ephemeralKey"))
71
- if (!(message.ephemeralKey && typeof message.ephemeralKey.length === "number" || $util.isString(message.ephemeralKey)))
70
+ const m = message;
71
+ if (m.ephemeralKey != null && Object.prototype.hasOwnProperty.call(m, "ephemeralKey"))
72
+ if (!(m.ephemeralKey?.length !== undefined || $util.isString(m.ephemeralKey)))
72
73
  return "ephemeralKey: buffer expected";
73
- if (message.counter != null && message.hasOwnProperty("counter"))
74
- if (!$util.isInteger(message.counter))
74
+ if (m.counter != null && Object.prototype.hasOwnProperty.call(m, "counter"))
75
+ if (!$util.isInteger(m.counter))
75
76
  return "counter: integer expected";
76
- if (message.previousCounter != null && message.hasOwnProperty("previousCounter"))
77
- if (!$util.isInteger(message.previousCounter))
77
+ if (m.previousCounter != null && Object.prototype.hasOwnProperty.call(m, "previousCounter"))
78
+ if (!$util.isInteger(m.previousCounter))
78
79
  return "previousCounter: integer expected";
79
- if (message.ciphertext != null && message.hasOwnProperty("ciphertext"))
80
- if (!(message.ciphertext && typeof message.ciphertext.length === "number" || $util.isString(message.ciphertext)))
80
+ if (m.ciphertext != null && Object.prototype.hasOwnProperty.call(m, "ciphertext"))
81
+ if (!(m.ciphertext?.length !== undefined || $util.isString(m.ciphertext)))
81
82
  return "ciphertext: buffer expected";
82
83
  return null;
83
- };
84
- WhisperMessage.fromObject = function fromObject(object) {
85
- if (object instanceof $root.textsecure.WhisperMessage)
84
+ }
85
+ static fromObject(object) {
86
+ if (object instanceof WhisperMessage)
86
87
  return object;
87
- var message = new $root.textsecure.WhisperMessage();
88
- if (object.ephemeralKey != null)
89
- if (typeof object.ephemeralKey === "string")
90
- $util.base64.decode(object.ephemeralKey, message.ephemeralKey = $util.newBuffer($util.base64.length(object.ephemeralKey)), 0);
91
- else if (object.ephemeralKey.length)
88
+ const message = new WhisperMessage();
89
+ if (object.ephemeralKey != null) {
90
+ if (typeof object.ephemeralKey === "string") {
91
+ message.ephemeralKey = $util.newBuffer($util.base64.length(object.ephemeralKey));
92
+ $util.base64.decode(object.ephemeralKey, message.ephemeralKey, 0);
93
+ }
94
+ else if (object.ephemeralKey.length) {
92
95
  message.ephemeralKey = object.ephemeralKey;
96
+ }
97
+ }
93
98
  if (object.counter != null)
94
99
  message.counter = object.counter >>> 0;
95
100
  if (object.previousCounter != null)
96
101
  message.previousCounter = object.previousCounter >>> 0;
97
- if (object.ciphertext != null)
98
- if (typeof object.ciphertext === "string")
99
- $util.base64.decode(object.ciphertext, message.ciphertext = $util.newBuffer($util.base64.length(object.ciphertext)), 0);
100
- else if (object.ciphertext.length)
102
+ if (object.ciphertext != null) {
103
+ if (typeof object.ciphertext === "string") {
104
+ message.ciphertext = $util.newBuffer($util.base64.length(object.ciphertext));
105
+ $util.base64.decode(object.ciphertext, message.ciphertext, 0);
106
+ }
107
+ else if (object.ciphertext.length) {
101
108
  message.ciphertext = object.ciphertext;
102
- return message;
103
- };
104
- WhisperMessage.toObject = function toObject(message, options) {
105
- if (!options)
106
- options = {};
107
- var object = {};
108
- if (options.defaults) {
109
- if (options.bytes === String)
110
- object.ephemeralKey = "";
111
- else {
112
- object.ephemeralKey = [];
113
- if (options.bytes !== Array)
114
- object.ephemeralKey = $util.newBuffer(object.ephemeralKey);
115
109
  }
110
+ }
111
+ return message;
112
+ }
113
+ static toObject(message, options) {
114
+ const o = options ?? {};
115
+ const object = {};
116
+ if (o.defaults) {
117
+ object.ephemeralKey = o.bytes === String ? "" : o.bytes === Array ? [] : $util.newBuffer([]);
116
118
  object.counter = 0;
117
119
  object.previousCounter = 0;
118
- if (options.bytes === String)
119
- object.ciphertext = "";
120
- else {
121
- object.ciphertext = [];
122
- if (options.bytes !== Array)
123
- object.ciphertext = $util.newBuffer(object.ciphertext);
124
- }
120
+ object.ciphertext = o.bytes === String ? "" : o.bytes === Array ? [] : $util.newBuffer([]);
125
121
  }
126
- if (message.ephemeralKey != null && message.hasOwnProperty("ephemeralKey"))
127
- object.ephemeralKey = options.bytes === String ? $util.base64.encode(message.ephemeralKey, 0, message.ephemeralKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.ephemeralKey) : message.ephemeralKey;
128
- if (message.counter != null && message.hasOwnProperty("counter"))
122
+ const m = message;
123
+ if (message.ephemeralKey != null && Object.prototype.hasOwnProperty.call(m, "ephemeralKey"))
124
+ object.ephemeralKey =
125
+ o.bytes === String
126
+ ? $util.base64.encode(message.ephemeralKey, 0, message.ephemeralKey.length)
127
+ : o.bytes === Array
128
+ ? Array.prototype.slice.call(message.ephemeralKey)
129
+ : message.ephemeralKey;
130
+ if (message.counter != null && Object.prototype.hasOwnProperty.call(m, "counter"))
129
131
  object.counter = message.counter;
130
- if (message.previousCounter != null && message.hasOwnProperty("previousCounter"))
132
+ if (message.previousCounter != null && Object.prototype.hasOwnProperty.call(m, "previousCounter"))
131
133
  object.previousCounter = message.previousCounter;
132
- if (message.ciphertext != null && message.hasOwnProperty("ciphertext"))
133
- object.ciphertext = options.bytes === String ? $util.base64.encode(message.ciphertext, 0, message.ciphertext.length) : options.bytes === Array ? Array.prototype.slice.call(message.ciphertext) : message.ciphertext;
134
+ if (message.ciphertext != null && Object.prototype.hasOwnProperty.call(m, "ciphertext"))
135
+ object.ciphertext =
136
+ o.bytes === String
137
+ ? $util.base64.encode(message.ciphertext, 0, message.ciphertext.length)
138
+ : o.bytes === Array
139
+ ? Array.prototype.slice.call(message.ciphertext)
140
+ : message.ciphertext;
134
141
  return object;
135
- };
136
- WhisperMessage.prototype.toJSON = function toJSON() {
137
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
138
- };
139
- return WhisperMessage;
140
- })();
141
- textsecure.PreKeyWhisperMessage = (function () {
142
- function PreKeyWhisperMessage(properties) {
143
- if (properties)
144
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
145
- if (properties[keys[i]] != null)
146
- this[keys[i]] = properties[keys[i]];
147
142
  }
148
- PreKeyWhisperMessage.prototype.registrationId = 0;
149
- PreKeyWhisperMessage.prototype.preKeyId = 0;
150
- PreKeyWhisperMessage.prototype.signedPreKeyId = 0;
151
- PreKeyWhisperMessage.prototype.baseKey = $util.newBuffer([]);
152
- PreKeyWhisperMessage.prototype.identityKey = $util.newBuffer([]);
153
- PreKeyWhisperMessage.prototype.message = $util.newBuffer([]);
154
- PreKeyWhisperMessage.create = function create(properties) {
143
+ toJSON() {
144
+ return WhisperMessage.toObject(this, $util.toJSONOptions);
145
+ }
146
+ }
147
+ textsecure.WhisperMessage = WhisperMessage;
148
+ WhisperMessage.prototype.ephemeralKey = $util.newBuffer([]);
149
+ WhisperMessage.prototype.counter = 0;
150
+ WhisperMessage.prototype.previousCounter = 0;
151
+ WhisperMessage.prototype.ciphertext = $util.newBuffer([]);
152
+ class PreKeyWhisperMessage {
153
+ constructor(properties) {
154
+ if (properties) {
155
+ for (const key of Object.keys(properties)) {
156
+ const value = properties[key];
157
+ if (value != null)
158
+ this[key] = value;
159
+ }
160
+ }
161
+ }
162
+ static create(properties) {
155
163
  return new PreKeyWhisperMessage(properties);
156
- };
157
- PreKeyWhisperMessage.encode = function encode(message, writer) {
164
+ }
165
+ static encode(message, writer) {
158
166
  if (!writer)
159
167
  writer = $Writer.create();
160
- if (message.preKeyId != null && message.hasOwnProperty("preKeyId"))
168
+ const own = message;
169
+ if (message.preKeyId != null && Object.prototype.hasOwnProperty.call(own, "preKeyId"))
161
170
  writer.uint32(8).uint32(message.preKeyId);
162
- if (message.baseKey != null && message.hasOwnProperty("baseKey"))
171
+ if (message.baseKey != null && Object.prototype.hasOwnProperty.call(own, "baseKey"))
163
172
  writer.uint32(18).bytes(message.baseKey);
164
- if (message.identityKey != null && message.hasOwnProperty("identityKey"))
173
+ if (message.identityKey != null && Object.prototype.hasOwnProperty.call(own, "identityKey"))
165
174
  writer.uint32(26).bytes(message.identityKey);
166
- if (message.message != null && message.hasOwnProperty("message"))
175
+ if (message.message != null && Object.prototype.hasOwnProperty.call(own, "message"))
167
176
  writer.uint32(34).bytes(message.message);
168
- if (message.registrationId != null && message.hasOwnProperty("registrationId"))
177
+ if (message.registrationId != null && Object.prototype.hasOwnProperty.call(own, "registrationId"))
169
178
  writer.uint32(40).uint32(message.registrationId);
170
- if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId"))
179
+ if (message.signedPreKeyId != null && Object.prototype.hasOwnProperty.call(own, "signedPreKeyId"))
171
180
  writer.uint32(48).uint32(message.signedPreKeyId);
172
181
  return writer;
173
- };
174
- PreKeyWhisperMessage.encodeDelimited = function encodeDelimited(message, writer) {
175
- return this.encode(message, writer).ldelim();
176
- };
177
- PreKeyWhisperMessage.decode = function decode(reader, length) {
178
- if (!(reader instanceof $Reader))
179
- reader = $Reader.create(reader);
180
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.textsecure.PreKeyWhisperMessage();
181
- while (reader.pos < end) {
182
- var tag = reader.uint32();
182
+ }
183
+ static encodeDelimited(message, writer) {
184
+ return PreKeyWhisperMessage.encode(message, writer).ldelim();
185
+ }
186
+ static decode(reader, length) {
187
+ const r = reader instanceof $Reader ? reader : $Reader.create(reader);
188
+ const end = length === undefined ? r.len : r.pos + length;
189
+ const message = new PreKeyWhisperMessage();
190
+ while (r.pos < end) {
191
+ const tag = r.uint32();
183
192
  switch (tag >>> 3) {
184
193
  case 5:
185
- message.registrationId = reader.uint32();
194
+ message.registrationId = r.uint32();
186
195
  break;
187
196
  case 1:
188
- message.preKeyId = reader.uint32();
197
+ message.preKeyId = r.uint32();
189
198
  break;
190
199
  case 6:
191
- message.signedPreKeyId = reader.uint32();
200
+ message.signedPreKeyId = r.uint32();
192
201
  break;
193
202
  case 2:
194
- message.baseKey = reader.bytes();
203
+ message.baseKey = r.bytes();
195
204
  break;
196
205
  case 3:
197
- message.identityKey = reader.bytes();
206
+ message.identityKey = r.bytes();
198
207
  break;
199
208
  case 4:
200
- message.message = reader.bytes();
209
+ message.message = r.bytes();
201
210
  break;
202
211
  default:
203
- reader.skipType(tag & 7);
212
+ r.skipType(tag & 7);
204
213
  break;
205
214
  }
206
215
  }
207
216
  return message;
208
- };
209
- PreKeyWhisperMessage.decodeDelimited = function decodeDelimited(reader) {
210
- if (!(reader instanceof $Reader))
211
- reader = new $Reader(reader);
212
- return this.decode(reader, reader.uint32());
213
- };
214
- PreKeyWhisperMessage.verify = function verify(message) {
217
+ }
218
+ static decodeDelimited(reader) {
219
+ const r = reader instanceof $Reader ? reader : new $Reader(reader);
220
+ return PreKeyWhisperMessage.decode(r, r.uint32());
221
+ }
222
+ static verify(message) {
215
223
  if (typeof message !== "object" || message === null)
216
224
  return "object expected";
217
- if (message.registrationId != null && message.hasOwnProperty("registrationId"))
218
- if (!$util.isInteger(message.registrationId))
225
+ const m = message;
226
+ if (m.registrationId != null && Object.prototype.hasOwnProperty.call(m, "registrationId"))
227
+ if (!$util.isInteger(m.registrationId))
219
228
  return "registrationId: integer expected";
220
- if (message.preKeyId != null && message.hasOwnProperty("preKeyId"))
221
- if (!$util.isInteger(message.preKeyId))
229
+ if (m.preKeyId != null && Object.prototype.hasOwnProperty.call(m, "preKeyId"))
230
+ if (!$util.isInteger(m.preKeyId))
222
231
  return "preKeyId: integer expected";
223
- if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId"))
224
- if (!$util.isInteger(message.signedPreKeyId))
232
+ if (m.signedPreKeyId != null && Object.prototype.hasOwnProperty.call(m, "signedPreKeyId"))
233
+ if (!$util.isInteger(m.signedPreKeyId))
225
234
  return "signedPreKeyId: integer expected";
226
- if (message.baseKey != null && message.hasOwnProperty("baseKey"))
227
- if (!(message.baseKey && typeof message.baseKey.length === "number" || $util.isString(message.baseKey)))
235
+ if (m.baseKey != null && Object.prototype.hasOwnProperty.call(m, "baseKey"))
236
+ if (!(m.baseKey?.length !== undefined || $util.isString(m.baseKey)))
228
237
  return "baseKey: buffer expected";
229
- if (message.identityKey != null && message.hasOwnProperty("identityKey"))
230
- if (!(message.identityKey && typeof message.identityKey.length === "number" || $util.isString(message.identityKey)))
238
+ if (m.identityKey != null && Object.prototype.hasOwnProperty.call(m, "identityKey"))
239
+ if (!(m.identityKey?.length !== undefined || $util.isString(m.identityKey)))
231
240
  return "identityKey: buffer expected";
232
- if (message.message != null && message.hasOwnProperty("message"))
233
- if (!(message.message && typeof message.message.length === "number" || $util.isString(message.message)))
241
+ if (m.message != null && Object.prototype.hasOwnProperty.call(m, "message"))
242
+ if (!(m.message?.length !== undefined || $util.isString(m.message)))
234
243
  return "message: buffer expected";
235
244
  return null;
236
- };
237
- PreKeyWhisperMessage.fromObject = function fromObject(object) {
238
- if (object instanceof $root.textsecure.PreKeyWhisperMessage)
245
+ }
246
+ static fromObject(object) {
247
+ if (object instanceof PreKeyWhisperMessage)
239
248
  return object;
240
- var message = new $root.textsecure.PreKeyWhisperMessage();
249
+ const message = new PreKeyWhisperMessage();
241
250
  if (object.registrationId != null)
242
251
  message.registrationId = object.registrationId >>> 0;
243
252
  if (object.preKeyId != null)
244
253
  message.preKeyId = object.preKeyId >>> 0;
245
254
  if (object.signedPreKeyId != null)
246
255
  message.signedPreKeyId = object.signedPreKeyId >>> 0;
247
- if (object.baseKey != null)
248
- if (typeof object.baseKey === "string")
249
- $util.base64.decode(object.baseKey, message.baseKey = $util.newBuffer($util.base64.length(object.baseKey)), 0);
250
- else if (object.baseKey.length)
256
+ if (object.baseKey != null) {
257
+ if (typeof object.baseKey === "string") {
258
+ message.baseKey = $util.newBuffer($util.base64.length(object.baseKey));
259
+ $util.base64.decode(object.baseKey, message.baseKey, 0);
260
+ }
261
+ else if (object.baseKey.length) {
251
262
  message.baseKey = object.baseKey;
252
- if (object.identityKey != null)
253
- if (typeof object.identityKey === "string")
254
- $util.base64.decode(object.identityKey, message.identityKey = $util.newBuffer($util.base64.length(object.identityKey)), 0);
255
- else if (object.identityKey.length)
263
+ }
264
+ }
265
+ if (object.identityKey != null) {
266
+ if (typeof object.identityKey === "string") {
267
+ message.identityKey = $util.newBuffer($util.base64.length(object.identityKey));
268
+ $util.base64.decode(object.identityKey, message.identityKey, 0);
269
+ }
270
+ else if (object.identityKey.length) {
256
271
  message.identityKey = object.identityKey;
257
- if (object.message != null)
258
- if (typeof object.message === "string")
259
- $util.base64.decode(object.message, message.message = $util.newBuffer($util.base64.length(object.message)), 0);
260
- else if (object.message.length)
261
- message.message = object.message;
262
- return message;
263
- };
264
- PreKeyWhisperMessage.toObject = function toObject(message, options) {
265
- if (!options)
266
- options = {};
267
- var object = {};
268
- if (options.defaults) {
269
- object.preKeyId = 0;
270
- if (options.bytes === String)
271
- object.baseKey = "";
272
- else {
273
- object.baseKey = [];
274
- if (options.bytes !== Array)
275
- object.baseKey = $util.newBuffer(object.baseKey);
276
272
  }
277
- if (options.bytes === String)
278
- object.identityKey = "";
279
- else {
280
- object.identityKey = [];
281
- if (options.bytes !== Array)
282
- object.identityKey = $util.newBuffer(object.identityKey);
273
+ }
274
+ if (object.message != null) {
275
+ if (typeof object.message === "string") {
276
+ message.message = $util.newBuffer($util.base64.length(object.message));
277
+ $util.base64.decode(object.message, message.message, 0);
283
278
  }
284
- if (options.bytes === String)
285
- object.message = "";
286
- else {
287
- object.message = [];
288
- if (options.bytes !== Array)
289
- object.message = $util.newBuffer(object.message);
279
+ else if (object.message.length) {
280
+ message.message = object.message;
290
281
  }
282
+ }
283
+ return message;
284
+ }
285
+ static toObject(message, options) {
286
+ const o = options ?? {};
287
+ const object = {};
288
+ if (o.defaults) {
289
+ object.preKeyId = 0;
290
+ object.baseKey = o.bytes === String ? "" : o.bytes === Array ? [] : $util.newBuffer([]);
291
+ object.identityKey = o.bytes === String ? "" : o.bytes === Array ? [] : $util.newBuffer([]);
292
+ object.message = o.bytes === String ? "" : o.bytes === Array ? [] : $util.newBuffer([]);
291
293
  object.registrationId = 0;
292
294
  object.signedPreKeyId = 0;
293
295
  }
294
- if (message.preKeyId != null && message.hasOwnProperty("preKeyId"))
296
+ const m = message;
297
+ if (message.preKeyId != null && Object.prototype.hasOwnProperty.call(m, "preKeyId"))
295
298
  object.preKeyId = message.preKeyId;
296
- if (message.baseKey != null && message.hasOwnProperty("baseKey"))
297
- object.baseKey = options.bytes === String ? $util.base64.encode(message.baseKey, 0, message.baseKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.baseKey) : message.baseKey;
298
- if (message.identityKey != null && message.hasOwnProperty("identityKey"))
299
- object.identityKey = options.bytes === String ? $util.base64.encode(message.identityKey, 0, message.identityKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityKey) : message.identityKey;
300
- if (message.message != null && message.hasOwnProperty("message"))
301
- object.message = options.bytes === String ? $util.base64.encode(message.message, 0, message.message.length) : options.bytes === Array ? Array.prototype.slice.call(message.message) : message.message;
302
- if (message.registrationId != null && message.hasOwnProperty("registrationId"))
299
+ if (message.baseKey != null && Object.prototype.hasOwnProperty.call(m, "baseKey"))
300
+ object.baseKey =
301
+ o.bytes === String
302
+ ? $util.base64.encode(message.baseKey, 0, message.baseKey.length)
303
+ : o.bytes === Array
304
+ ? Array.prototype.slice.call(message.baseKey)
305
+ : message.baseKey;
306
+ if (message.identityKey != null && Object.prototype.hasOwnProperty.call(m, "identityKey"))
307
+ object.identityKey =
308
+ o.bytes === String
309
+ ? $util.base64.encode(message.identityKey, 0, message.identityKey.length)
310
+ : o.bytes === Array
311
+ ? Array.prototype.slice.call(message.identityKey)
312
+ : message.identityKey;
313
+ if (message.message != null && Object.prototype.hasOwnProperty.call(m, "message"))
314
+ object.message =
315
+ o.bytes === String
316
+ ? $util.base64.encode(message.message, 0, message.message.length)
317
+ : o.bytes === Array
318
+ ? Array.prototype.slice.call(message.message)
319
+ : message.message;
320
+ if (message.registrationId != null && Object.prototype.hasOwnProperty.call(m, "registrationId"))
303
321
  object.registrationId = message.registrationId;
304
- if (message.signedPreKeyId != null && message.hasOwnProperty("signedPreKeyId"))
322
+ if (message.signedPreKeyId != null && Object.prototype.hasOwnProperty.call(m, "signedPreKeyId"))
305
323
  object.signedPreKeyId = message.signedPreKeyId;
306
324
  return object;
307
- };
308
- PreKeyWhisperMessage.prototype.toJSON = function toJSON() {
309
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
310
- };
311
- return PreKeyWhisperMessage;
312
- })();
313
- textsecure.KeyExchangeMessage = (function () {
314
- function KeyExchangeMessage(properties) {
315
- if (properties)
316
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
317
- if (properties[keys[i]] != null)
318
- this[keys[i]] = properties[keys[i]];
319
325
  }
320
- KeyExchangeMessage.prototype.id = 0;
321
- KeyExchangeMessage.prototype.baseKey = $util.newBuffer([]);
322
- KeyExchangeMessage.prototype.ephemeralKey = $util.newBuffer([]);
323
- KeyExchangeMessage.prototype.identityKey = $util.newBuffer([]);
324
- KeyExchangeMessage.prototype.baseKeySignature = $util.newBuffer([]);
325
- KeyExchangeMessage.create = function create(properties) {
326
+ toJSON() {
327
+ return PreKeyWhisperMessage.toObject(this, $util.toJSONOptions);
328
+ }
329
+ }
330
+ textsecure.PreKeyWhisperMessage = PreKeyWhisperMessage;
331
+ PreKeyWhisperMessage.prototype.registrationId = 0;
332
+ PreKeyWhisperMessage.prototype.preKeyId = 0;
333
+ PreKeyWhisperMessage.prototype.signedPreKeyId = 0;
334
+ PreKeyWhisperMessage.prototype.baseKey = $util.newBuffer([]);
335
+ PreKeyWhisperMessage.prototype.identityKey = $util.newBuffer([]);
336
+ PreKeyWhisperMessage.prototype.message = $util.newBuffer([]);
337
+ class KeyExchangeMessage {
338
+ constructor(properties) {
339
+ if (properties) {
340
+ for (const key of Object.keys(properties)) {
341
+ const value = properties[key];
342
+ if (value != null)
343
+ this[key] = value;
344
+ }
345
+ }
346
+ }
347
+ static create(properties) {
326
348
  return new KeyExchangeMessage(properties);
327
- };
328
- KeyExchangeMessage.encode = function encode(message, writer) {
349
+ }
350
+ static encode(message, writer) {
329
351
  if (!writer)
330
352
  writer = $Writer.create();
331
- if (message.id != null && message.hasOwnProperty("id"))
353
+ const own = message;
354
+ if (message.id != null && Object.prototype.hasOwnProperty.call(own, "id"))
332
355
  writer.uint32(8).uint32(message.id);
333
- if (message.baseKey != null && message.hasOwnProperty("baseKey"))
356
+ if (message.baseKey != null && Object.prototype.hasOwnProperty.call(own, "baseKey"))
334
357
  writer.uint32(18).bytes(message.baseKey);
335
- if (message.ephemeralKey != null && message.hasOwnProperty("ephemeralKey"))
358
+ if (message.ephemeralKey != null && Object.prototype.hasOwnProperty.call(own, "ephemeralKey"))
336
359
  writer.uint32(26).bytes(message.ephemeralKey);
337
- if (message.identityKey != null && message.hasOwnProperty("identityKey"))
360
+ if (message.identityKey != null && Object.prototype.hasOwnProperty.call(own, "identityKey"))
338
361
  writer.uint32(34).bytes(message.identityKey);
339
- if (message.baseKeySignature != null && message.hasOwnProperty("baseKeySignature"))
362
+ if (message.baseKeySignature != null && Object.prototype.hasOwnProperty.call(own, "baseKeySignature"))
340
363
  writer.uint32(42).bytes(message.baseKeySignature);
341
364
  return writer;
342
- };
343
- KeyExchangeMessage.encodeDelimited = function encodeDelimited(message, writer) {
344
- return this.encode(message, writer).ldelim();
345
- };
346
- KeyExchangeMessage.decode = function decode(reader, length) {
347
- if (!(reader instanceof $Reader))
348
- reader = $Reader.create(reader);
349
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.textsecure.KeyExchangeMessage();
350
- while (reader.pos < end) {
351
- var tag = reader.uint32();
365
+ }
366
+ static encodeDelimited(message, writer) {
367
+ return KeyExchangeMessage.encode(message, writer).ldelim();
368
+ }
369
+ static decode(reader, length) {
370
+ const r = reader instanceof $Reader ? reader : $Reader.create(reader);
371
+ const end = length === undefined ? r.len : r.pos + length;
372
+ const message = new KeyExchangeMessage();
373
+ while (r.pos < end) {
374
+ const tag = r.uint32();
352
375
  switch (tag >>> 3) {
353
376
  case 1:
354
- message.id = reader.uint32();
377
+ message.id = r.uint32();
355
378
  break;
356
379
  case 2:
357
- message.baseKey = reader.bytes();
380
+ message.baseKey = r.bytes();
358
381
  break;
359
382
  case 3:
360
- message.ephemeralKey = reader.bytes();
383
+ message.ephemeralKey = r.bytes();
361
384
  break;
362
385
  case 4:
363
- message.identityKey = reader.bytes();
386
+ message.identityKey = r.bytes();
364
387
  break;
365
388
  case 5:
366
- message.baseKeySignature = reader.bytes();
389
+ message.baseKeySignature = r.bytes();
367
390
  break;
368
391
  default:
369
- reader.skipType(tag & 7);
392
+ r.skipType(tag & 7);
370
393
  break;
371
394
  }
372
395
  }
373
396
  return message;
374
- };
375
- KeyExchangeMessage.decodeDelimited = function decodeDelimited(reader) {
376
- if (!(reader instanceof $Reader))
377
- reader = new $Reader(reader);
378
- return this.decode(reader, reader.uint32());
379
- };
380
- KeyExchangeMessage.verify = function verify(message) {
397
+ }
398
+ static decodeDelimited(reader) {
399
+ const r = reader instanceof $Reader ? reader : new $Reader(reader);
400
+ return KeyExchangeMessage.decode(r, r.uint32());
401
+ }
402
+ static verify(message) {
381
403
  if (typeof message !== "object" || message === null)
382
404
  return "object expected";
383
- if (message.id != null && message.hasOwnProperty("id"))
384
- if (!$util.isInteger(message.id))
405
+ const m = message;
406
+ if (m.id != null && Object.prototype.hasOwnProperty.call(m, "id"))
407
+ if (!$util.isInteger(m.id))
385
408
  return "id: integer expected";
386
- if (message.baseKey != null && message.hasOwnProperty("baseKey"))
387
- if (!(message.baseKey && typeof message.baseKey.length === "number" || $util.isString(message.baseKey)))
409
+ if (m.baseKey != null && Object.prototype.hasOwnProperty.call(m, "baseKey"))
410
+ if (!(m.baseKey?.length !== undefined || $util.isString(m.baseKey)))
388
411
  return "baseKey: buffer expected";
389
- if (message.ephemeralKey != null && message.hasOwnProperty("ephemeralKey"))
390
- if (!(message.ephemeralKey && typeof message.ephemeralKey.length === "number" || $util.isString(message.ephemeralKey)))
412
+ if (m.ephemeralKey != null && Object.prototype.hasOwnProperty.call(m, "ephemeralKey"))
413
+ if (!(m.ephemeralKey?.length !== undefined || $util.isString(m.ephemeralKey)))
391
414
  return "ephemeralKey: buffer expected";
392
- if (message.identityKey != null && message.hasOwnProperty("identityKey"))
393
- if (!(message.identityKey && typeof message.identityKey.length === "number" || $util.isString(message.identityKey)))
415
+ if (m.identityKey != null && Object.prototype.hasOwnProperty.call(m, "identityKey"))
416
+ if (!(m.identityKey?.length !== undefined || $util.isString(m.identityKey)))
394
417
  return "identityKey: buffer expected";
395
- if (message.baseKeySignature != null && message.hasOwnProperty("baseKeySignature"))
396
- if (!(message.baseKeySignature && typeof message.baseKeySignature.length === "number" || $util.isString(message.baseKeySignature)))
418
+ if (m.baseKeySignature != null && Object.prototype.hasOwnProperty.call(m, "baseKeySignature"))
419
+ if (!(m.baseKeySignature?.length !== undefined || $util.isString(m.baseKeySignature)))
397
420
  return "baseKeySignature: buffer expected";
398
421
  return null;
399
- };
400
- KeyExchangeMessage.fromObject = function fromObject(object) {
401
- if (object instanceof $root.textsecure.KeyExchangeMessage)
422
+ }
423
+ static fromObject(object) {
424
+ if (object instanceof KeyExchangeMessage)
402
425
  return object;
403
- var message = new $root.textsecure.KeyExchangeMessage();
426
+ const message = new KeyExchangeMessage();
404
427
  if (object.id != null)
405
428
  message.id = object.id >>> 0;
406
- if (object.baseKey != null)
407
- if (typeof object.baseKey === "string")
408
- $util.base64.decode(object.baseKey, message.baseKey = $util.newBuffer($util.base64.length(object.baseKey)), 0);
409
- else if (object.baseKey.length)
429
+ if (object.baseKey != null) {
430
+ if (typeof object.baseKey === "string") {
431
+ message.baseKey = $util.newBuffer($util.base64.length(object.baseKey));
432
+ $util.base64.decode(object.baseKey, message.baseKey, 0);
433
+ }
434
+ else if (object.baseKey.length) {
410
435
  message.baseKey = object.baseKey;
411
- if (object.ephemeralKey != null)
412
- if (typeof object.ephemeralKey === "string")
413
- $util.base64.decode(object.ephemeralKey, message.ephemeralKey = $util.newBuffer($util.base64.length(object.ephemeralKey)), 0);
414
- else if (object.ephemeralKey.length)
436
+ }
437
+ }
438
+ if (object.ephemeralKey != null) {
439
+ if (typeof object.ephemeralKey === "string") {
440
+ message.ephemeralKey = $util.newBuffer($util.base64.length(object.ephemeralKey));
441
+ $util.base64.decode(object.ephemeralKey, message.ephemeralKey, 0);
442
+ }
443
+ else if (object.ephemeralKey.length) {
415
444
  message.ephemeralKey = object.ephemeralKey;
416
- if (object.identityKey != null)
417
- if (typeof object.identityKey === "string")
418
- $util.base64.decode(object.identityKey, message.identityKey = $util.newBuffer($util.base64.length(object.identityKey)), 0);
419
- else if (object.identityKey.length)
420
- message.identityKey = object.identityKey;
421
- if (object.baseKeySignature != null)
422
- if (typeof object.baseKeySignature === "string")
423
- $util.base64.decode(object.baseKeySignature, message.baseKeySignature = $util.newBuffer($util.base64.length(object.baseKeySignature)), 0);
424
- else if (object.baseKeySignature.length)
425
- message.baseKeySignature = object.baseKeySignature;
426
- return message;
427
- };
428
- KeyExchangeMessage.toObject = function toObject(message, options) {
429
- if (!options)
430
- options = {};
431
- var object = {};
432
- if (options.defaults) {
433
- object.id = 0;
434
- if (options.bytes === String)
435
- object.baseKey = "";
436
- else {
437
- object.baseKey = [];
438
- if (options.bytes !== Array)
439
- object.baseKey = $util.newBuffer(object.baseKey);
440
445
  }
441
- if (options.bytes === String)
442
- object.ephemeralKey = "";
443
- else {
444
- object.ephemeralKey = [];
445
- if (options.bytes !== Array)
446
- object.ephemeralKey = $util.newBuffer(object.ephemeralKey);
446
+ }
447
+ if (object.identityKey != null) {
448
+ if (typeof object.identityKey === "string") {
449
+ message.identityKey = $util.newBuffer($util.base64.length(object.identityKey));
450
+ $util.base64.decode(object.identityKey, message.identityKey, 0);
447
451
  }
448
- if (options.bytes === String)
449
- object.identityKey = "";
450
- else {
451
- object.identityKey = [];
452
- if (options.bytes !== Array)
453
- object.identityKey = $util.newBuffer(object.identityKey);
452
+ else if (object.identityKey.length) {
453
+ message.identityKey = object.identityKey;
454
454
  }
455
- if (options.bytes === String)
456
- object.baseKeySignature = "";
457
- else {
458
- object.baseKeySignature = [];
459
- if (options.bytes !== Array)
460
- object.baseKeySignature = $util.newBuffer(object.baseKeySignature);
455
+ }
456
+ if (object.baseKeySignature != null) {
457
+ if (typeof object.baseKeySignature === "string") {
458
+ message.baseKeySignature = $util.newBuffer($util.base64.length(object.baseKeySignature));
459
+ $util.base64.decode(object.baseKeySignature, message.baseKeySignature, 0);
461
460
  }
461
+ else if (object.baseKeySignature.length) {
462
+ message.baseKeySignature = object.baseKeySignature;
463
+ }
464
+ }
465
+ return message;
466
+ }
467
+ static toObject(message, options) {
468
+ const o = options ?? {};
469
+ const object = {};
470
+ if (o.defaults) {
471
+ object.id = 0;
472
+ object.baseKey = o.bytes === String ? "" : o.bytes === Array ? [] : $util.newBuffer([]);
473
+ object.ephemeralKey = o.bytes === String ? "" : o.bytes === Array ? [] : $util.newBuffer([]);
474
+ object.identityKey = o.bytes === String ? "" : o.bytes === Array ? [] : $util.newBuffer([]);
475
+ object.baseKeySignature = o.bytes === String ? "" : o.bytes === Array ? [] : $util.newBuffer([]);
462
476
  }
463
- if (message.id != null && message.hasOwnProperty("id"))
477
+ const m = message;
478
+ if (message.id != null && Object.prototype.hasOwnProperty.call(m, "id"))
464
479
  object.id = message.id;
465
- if (message.baseKey != null && message.hasOwnProperty("baseKey"))
466
- object.baseKey = options.bytes === String ? $util.base64.encode(message.baseKey, 0, message.baseKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.baseKey) : message.baseKey;
467
- if (message.ephemeralKey != null && message.hasOwnProperty("ephemeralKey"))
468
- object.ephemeralKey = options.bytes === String ? $util.base64.encode(message.ephemeralKey, 0, message.ephemeralKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.ephemeralKey) : message.ephemeralKey;
469
- if (message.identityKey != null && message.hasOwnProperty("identityKey"))
470
- object.identityKey = options.bytes === String ? $util.base64.encode(message.identityKey, 0, message.identityKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityKey) : message.identityKey;
471
- if (message.baseKeySignature != null && message.hasOwnProperty("baseKeySignature"))
472
- object.baseKeySignature = options.bytes === String ? $util.base64.encode(message.baseKeySignature, 0, message.baseKeySignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.baseKeySignature) : message.baseKeySignature;
480
+ if (message.baseKey != null && Object.prototype.hasOwnProperty.call(m, "baseKey"))
481
+ object.baseKey =
482
+ o.bytes === String
483
+ ? $util.base64.encode(message.baseKey, 0, message.baseKey.length)
484
+ : o.bytes === Array
485
+ ? Array.prototype.slice.call(message.baseKey)
486
+ : message.baseKey;
487
+ if (message.ephemeralKey != null && Object.prototype.hasOwnProperty.call(m, "ephemeralKey"))
488
+ object.ephemeralKey =
489
+ o.bytes === String
490
+ ? $util.base64.encode(message.ephemeralKey, 0, message.ephemeralKey.length)
491
+ : o.bytes === Array
492
+ ? Array.prototype.slice.call(message.ephemeralKey)
493
+ : message.ephemeralKey;
494
+ if (message.identityKey != null && Object.prototype.hasOwnProperty.call(m, "identityKey"))
495
+ object.identityKey =
496
+ o.bytes === String
497
+ ? $util.base64.encode(message.identityKey, 0, message.identityKey.length)
498
+ : o.bytes === Array
499
+ ? Array.prototype.slice.call(message.identityKey)
500
+ : message.identityKey;
501
+ if (message.baseKeySignature != null && Object.prototype.hasOwnProperty.call(m, "baseKeySignature"))
502
+ object.baseKeySignature =
503
+ o.bytes === String
504
+ ? $util.base64.encode(message.baseKeySignature, 0, message.baseKeySignature.length)
505
+ : o.bytes === Array
506
+ ? Array.prototype.slice.call(message.baseKeySignature)
507
+ : message.baseKeySignature;
473
508
  return object;
474
- };
475
- KeyExchangeMessage.prototype.toJSON = function toJSON() {
476
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
477
- };
478
- return KeyExchangeMessage;
479
- })();
480
- return textsecure;
481
- })();
509
+ }
510
+ toJSON() {
511
+ return KeyExchangeMessage.toObject(this, $util.toJSONOptions);
512
+ }
513
+ }
514
+ textsecure.KeyExchangeMessage = KeyExchangeMessage;
515
+ KeyExchangeMessage.prototype.id = 0;
516
+ KeyExchangeMessage.prototype.baseKey = $util.newBuffer([]);
517
+ KeyExchangeMessage.prototype.ephemeralKey = $util.newBuffer([]);
518
+ KeyExchangeMessage.prototype.identityKey = $util.newBuffer([]);
519
+ KeyExchangeMessage.prototype.baseKeySignature = $util.newBuffer([]);
520
+ })(textsecure || (textsecure = {}));
521
+ const $root = { textsecure };
482
522
  export default $root;
483
- export const textsecure = $root.textsecure;
523
+ //# sourceMappingURL=whisper-text-protocol.js.map