@acpantenna/relay-protocol 0.0.0-stage → 0.3.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/LICENSE +21 -0
- package/README.md +54 -2
- package/dist/bip39-english.d.ts +28 -0
- package/dist/bip39-english.d.ts.map +1 -0
- package/dist/bip39-english.js +28 -0
- package/dist/bip39-english.js.map +1 -0
- package/dist/bytes.d.ts +21 -0
- package/dist/bytes.d.ts.map +1 -0
- package/dist/bytes.js +114 -0
- package/dist/bytes.js.map +1 -0
- package/dist/frames.d.ts +90 -0
- package/dist/frames.d.ts.map +1 -0
- package/dist/frames.js +234 -0
- package/dist/frames.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/link.d.ts +44 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +120 -0
- package/dist/link.js.map +1 -0
- package/dist/noise.d.ts +181 -0
- package/dist/noise.d.ts.map +1 -0
- package/dist/noise.js +490 -0
- package/dist/noise.js.map +1 -0
- package/dist/relay.d.ts +37 -0
- package/dist/relay.d.ts.map +1 -0
- package/dist/relay.js +70 -0
- package/dist/relay.js.map +1 -0
- package/dist/sas.d.ts +11 -0
- package/dist/sas.d.ts.map +1 -0
- package/dist/sas.js +26 -0
- package/dist/sas.js.map +1 -0
- package/dist/session.d.ts +298 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +608 -0
- package/dist/session.js.map +1 -0
- package/package.json +56 -5
- package/src/bip39-english.ts +30 -0
- package/src/bytes.ts +125 -0
- package/src/frames.ts +278 -0
- package/src/index.ts +14 -0
- package/src/link.ts +160 -0
- package/src/noise.ts +655 -0
- package/src/relay.ts +106 -0
- package/src/sas.ts +28 -0
- package/src/session.ts +848 -0
- package/test-vectors/frames.json +353 -0
- package/test-vectors/noise-kk.json +43 -0
- package/test-vectors/noise-nkpsk0.json +47 -0
- package/test-vectors/sas.json +21 -0
- package/test-vectors/session.json +58 -0
package/dist/sas.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The short authentication string: four words both sides show, so the user
|
|
3
|
+
* can see they are talking to the same peer. They come from
|
|
4
|
+
* `BLAKE2s("acpantenna-sas" ‖ h)`, `h` being the final handshake hash: its
|
|
5
|
+
* first 44 bits, most significant first, as four 11-bit indexes into the
|
|
6
|
+
* BIP-39 English wordlist.
|
|
7
|
+
*/
|
|
8
|
+
import { blake2s } from "@noble/hashes/blake2.js";
|
|
9
|
+
import { BIP39_ENGLISH } from "./bip39-english.js";
|
|
10
|
+
import { concatBytes, utf8Encode } from "./bytes.js";
|
|
11
|
+
export const SAS_LABEL = "acpantenna-sas";
|
|
12
|
+
export const SAS_WORDS = 4;
|
|
13
|
+
export function sasWords(handshakeHash) {
|
|
14
|
+
const digest = blake2s(concatBytes(utf8Encode(SAS_LABEL), handshakeHash));
|
|
15
|
+
const words = [];
|
|
16
|
+
for (let word = 0; word < SAS_WORDS; word++) {
|
|
17
|
+
let index = 0;
|
|
18
|
+
for (let bit = word * 11; bit < word * 11 + 11; bit++) {
|
|
19
|
+
const byte = digest[bit >> 3] ?? 0;
|
|
20
|
+
index = (index << 1) | ((byte >> (7 - (bit & 7))) & 1);
|
|
21
|
+
}
|
|
22
|
+
words.push(BIP39_ENGLISH[index]);
|
|
23
|
+
}
|
|
24
|
+
return words;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=sas.js.map
|
package/dist/sas.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sas.js","sourceRoot":"","sources":["../src/sas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAC1C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC;AAE3B,MAAM,UAAU,QAAQ,CAAC,aAAyB;IACjD,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC;IAC1E,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;QAC7C,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,KAAK,IAAI,GAAG,GAAG,IAAI,GAAG,EAAE,EAAE,GAAG,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC;YACvD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;YACnC,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACxD,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAW,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One end of an encrypted channel over a relay: the Noise handshake, then
|
|
3
|
+
* framed ACP messages. Both sides use it — the browser as the
|
|
4
|
+
* {@link initiator}, the agent side as the {@link responder} — to pair with
|
|
5
|
+
* a link, and a remembered browser and the agent side to reconnect
|
|
6
|
+
* ({@link reconnectInitiator}, {@link reconnectResponder}).
|
|
7
|
+
*
|
|
8
|
+
* The session does no I/O of its own. Give it `send`, which puts one binary
|
|
9
|
+
* message on the relay socket, and hand every binary message from the socket
|
|
10
|
+
* to `receive`. When the socket ends, call `transportClosed`.
|
|
11
|
+
*/
|
|
12
|
+
import { type PairingLink } from "./link.ts";
|
|
13
|
+
import { type HandshakeResult, type KeyPair, type StaticKey } from "./noise.ts";
|
|
14
|
+
/** Each side rekeys its sending CipherState after this many messages, and its receiving one likewise. */
|
|
15
|
+
export declare const REKEY_INTERVAL = 10000;
|
|
16
|
+
/** How much of what it sent each side keeps by default, to resend after a reconnect. */
|
|
17
|
+
export declare const DEFAULT_RESUME_BYTES: number;
|
|
18
|
+
/**
|
|
19
|
+
* What one side keeps across the transports of a connection, so a reconnect
|
|
20
|
+
* loses nothing: ACP stream ids go on counting from one transport to the
|
|
21
|
+
* next, and the messages most recently sent are kept to send again.
|
|
22
|
+
*/
|
|
23
|
+
export declare class ResumeBuffer {
|
|
24
|
+
private readonly maxBytes;
|
|
25
|
+
/** The last stream received whole from the other side. */
|
|
26
|
+
received: number;
|
|
27
|
+
private next;
|
|
28
|
+
private kept;
|
|
29
|
+
private keptBytes;
|
|
30
|
+
constructor(maxBytes?: number);
|
|
31
|
+
/** The stream id of the next message sent. */
|
|
32
|
+
get nextStream(): number;
|
|
33
|
+
/** Numbers a message to send and keeps it, dropping the oldest past the limit. */
|
|
34
|
+
add(message: string): number;
|
|
35
|
+
/**
|
|
36
|
+
* The messages sent after stream `stream`, which the other side says it
|
|
37
|
+
* received last; undefined if some are no longer kept (or never were).
|
|
38
|
+
*/
|
|
39
|
+
after(stream: number): {
|
|
40
|
+
stream: number;
|
|
41
|
+
message: string;
|
|
42
|
+
}[] | undefined;
|
|
43
|
+
/** Starts again from stream 1 both ways: nothing before is resent. */
|
|
44
|
+
reset(): void;
|
|
45
|
+
}
|
|
46
|
+
export type SessionState =
|
|
47
|
+
/** The initiator has not called `start` yet. */
|
|
48
|
+
"idle"
|
|
49
|
+
/** The handshake is under way. */
|
|
50
|
+
| "handshake"
|
|
51
|
+
/**
|
|
52
|
+
* Keys confirmed (the initiator's first frame, a PING, has decrypted);
|
|
53
|
+
* waiting for the user to confirm the SAS words on the agent side, or,
|
|
54
|
+
* reconnecting, for the agent side's CONFIRMED.
|
|
55
|
+
*/
|
|
56
|
+
| "pairing"
|
|
57
|
+
/** Confirmed: ACP messages flow both ways. */
|
|
58
|
+
| "open" | "closed";
|
|
59
|
+
export interface HandshakeInfo {
|
|
60
|
+
/** The four SAS words both sides show. */
|
|
61
|
+
sas: string[];
|
|
62
|
+
/** The final handshake hash `h`. */
|
|
63
|
+
handshakeHash: Uint8Array;
|
|
64
|
+
}
|
|
65
|
+
export type CloseEvent =
|
|
66
|
+
/** An authenticated CLOSE was sent or received: the session ended on purpose. */
|
|
67
|
+
{
|
|
68
|
+
kind: "ended";
|
|
69
|
+
reason: string;
|
|
70
|
+
byPeer: boolean;
|
|
71
|
+
}
|
|
72
|
+
/** The socket ended without an authenticated CLOSE. Report it as "connection lost". */
|
|
73
|
+
| {
|
|
74
|
+
kind: "lost";
|
|
75
|
+
reason: string;
|
|
76
|
+
}
|
|
77
|
+
/** A rule was broken or a message failed to decrypt. The socket must be closed. */
|
|
78
|
+
| {
|
|
79
|
+
kind: "error";
|
|
80
|
+
reason: string;
|
|
81
|
+
error: Error;
|
|
82
|
+
};
|
|
83
|
+
export interface SessionHandlers {
|
|
84
|
+
/**
|
|
85
|
+
* Show `sas` to the user. The initiator calls it when the handshake
|
|
86
|
+
* finishes, the responder only once the keys are confirmed.
|
|
87
|
+
*/
|
|
88
|
+
onHandshake?: (info: HandshakeInfo) => void;
|
|
89
|
+
/**
|
|
90
|
+
* Responder only: the first transport message from the initiator decrypted,
|
|
91
|
+
* so the peer really holds the keys (key confirmation). Only now is the
|
|
92
|
+
* link's psk used up. Reconnecting, the session is already open by then:
|
|
93
|
+
* there are no words, so the responder sends CONFIRMED by itself.
|
|
94
|
+
*/
|
|
95
|
+
onKeyConfirmed?: () => void;
|
|
96
|
+
/** Initiator only: the agent side sent CONFIRMED; `send` may now be used. */
|
|
97
|
+
onConfirmed?: () => void;
|
|
98
|
+
/**
|
|
99
|
+
* Responder only, after a pairing: the browser sent its static public key
|
|
100
|
+
* (REMEMBER), to reconnect with later.
|
|
101
|
+
*/
|
|
102
|
+
onRemember?: (publicKey: Uint8Array) => void;
|
|
103
|
+
/** One whole ACP message (a JSON-RPC 2.0 message, as text). */
|
|
104
|
+
onMessage?: (message: string) => void;
|
|
105
|
+
/** A PONG answered a PING. */
|
|
106
|
+
onPong?: (payload: Uint8Array) => void;
|
|
107
|
+
/** The session is over, for one of the reasons in {@link CloseEvent}. */
|
|
108
|
+
onClose?: (event: CloseEvent) => void;
|
|
109
|
+
}
|
|
110
|
+
export interface SessionOptions extends SessionHandlers {
|
|
111
|
+
/** Puts one binary message on the relay socket. */
|
|
112
|
+
send: (data: Uint8Array) => void;
|
|
113
|
+
/** The largest ACP message accepted from the peer. Defaults to 32 MiB. */
|
|
114
|
+
maxMessageBytes?: number;
|
|
115
|
+
/** Fixes the ephemeral key, for tests only. */
|
|
116
|
+
ephemeralPrivateKey?: Uint8Array;
|
|
117
|
+
/**
|
|
118
|
+
* Kept across the transports of one connection: give a reconnect the
|
|
119
|
+
* buffer the connection's earlier sessions used. A new one by default.
|
|
120
|
+
*/
|
|
121
|
+
buffer?: ResumeBuffer;
|
|
122
|
+
}
|
|
123
|
+
export interface InitiatorOptions extends SessionOptions {
|
|
124
|
+
/** The parsed pairing link. Check its expiry first. */
|
|
125
|
+
link: PairingLink;
|
|
126
|
+
}
|
|
127
|
+
export interface ReconnectInitiatorOptions extends SessionOptions {
|
|
128
|
+
room: Uint8Array;
|
|
129
|
+
webOrigin: string;
|
|
130
|
+
/** The agent side's static key, from the link the browser paired with. */
|
|
131
|
+
remoteStaticPublicKey: Uint8Array;
|
|
132
|
+
/** The browser's own static key, whose public half it sent in REMEMBER. */
|
|
133
|
+
staticKey: StaticKey;
|
|
134
|
+
/**
|
|
135
|
+
* Ask to carry on where the last transport stopped, with `buffer`'s
|
|
136
|
+
* streams. False for a page that has lost them (a reload): both sides
|
|
137
|
+
* start again from stream 1, and the browser loads the session afresh.
|
|
138
|
+
*/
|
|
139
|
+
resume: boolean;
|
|
140
|
+
}
|
|
141
|
+
export interface ReconnectResponderOptions extends SessionOptions {
|
|
142
|
+
staticKeyPair: KeyPair;
|
|
143
|
+
room: Uint8Array;
|
|
144
|
+
webOrigin: string;
|
|
145
|
+
/** The browser's static key, from its REMEMBER. */
|
|
146
|
+
remoteStaticPublicKey: Uint8Array;
|
|
147
|
+
}
|
|
148
|
+
export interface ResponderOptions extends SessionOptions {
|
|
149
|
+
staticKeyPair: KeyPair;
|
|
150
|
+
psk: Uint8Array;
|
|
151
|
+
room: Uint8Array;
|
|
152
|
+
webOrigin: string;
|
|
153
|
+
/**
|
|
154
|
+
* Called with the initiator's ephemeral key once message 1 has decrypted.
|
|
155
|
+
* Return false if it has been seen before while the link is valid: the
|
|
156
|
+
* message is a replay, and the session fails.
|
|
157
|
+
*/
|
|
158
|
+
acceptEphemeral?: (ephemeralPublicKey: Uint8Array) => boolean;
|
|
159
|
+
}
|
|
160
|
+
export declare class SessionError extends Error {
|
|
161
|
+
constructor(message: string);
|
|
162
|
+
}
|
|
163
|
+
/** Either handshake: NKpsk0 steps are synchronous, KK steps asynchronous. */
|
|
164
|
+
interface Handshake {
|
|
165
|
+
writeMessage(payload: Uint8Array): Uint8Array | Promise<Uint8Array>;
|
|
166
|
+
readMessage(message: Uint8Array): Uint8Array | Promise<Uint8Array>;
|
|
167
|
+
readonly result: HandshakeResult | undefined;
|
|
168
|
+
}
|
|
169
|
+
/** One end of the channel. Use {@link initiator} or {@link responder} to make one. */
|
|
170
|
+
export declare class RelaySession implements SessionHandlers {
|
|
171
|
+
readonly role: "initiator" | "responder";
|
|
172
|
+
/** A first pairing with a link, or a remembered browser coming back. */
|
|
173
|
+
readonly kind: "pairing" | "reconnect";
|
|
174
|
+
/** What this side keeps across the connection's transports. */
|
|
175
|
+
readonly buffer: ResumeBuffer;
|
|
176
|
+
onHandshake: SessionHandlers["onHandshake"];
|
|
177
|
+
onKeyConfirmed: SessionHandlers["onKeyConfirmed"];
|
|
178
|
+
onConfirmed: SessionHandlers["onConfirmed"];
|
|
179
|
+
onMessage: SessionHandlers["onMessage"];
|
|
180
|
+
onPong: SessionHandlers["onPong"];
|
|
181
|
+
onRemember: SessionHandlers["onRemember"];
|
|
182
|
+
onClose: SessionHandlers["onClose"];
|
|
183
|
+
private stateValue;
|
|
184
|
+
private readonly handshake;
|
|
185
|
+
private readonly sendRaw;
|
|
186
|
+
private readonly acceptEphemeral;
|
|
187
|
+
private reassembler;
|
|
188
|
+
private readonly maxMessageBytes;
|
|
189
|
+
private readonly askResume;
|
|
190
|
+
private sendCipher;
|
|
191
|
+
private receiveCipher;
|
|
192
|
+
private keyConfirmed;
|
|
193
|
+
private resumedValue;
|
|
194
|
+
private info;
|
|
195
|
+
/** REMEMBER has been sent or received. */
|
|
196
|
+
private remembered;
|
|
197
|
+
/** An ACP message has gone, or come, since CONFIRMED: too late for REMEMBER. */
|
|
198
|
+
private acpSeen;
|
|
199
|
+
/** A handshake step is waiting on an asynchronous DH. */
|
|
200
|
+
private busy;
|
|
201
|
+
/** What arrived meanwhile, in order. */
|
|
202
|
+
private readonly backlog;
|
|
203
|
+
constructor(role: "initiator" | "responder", kind: "pairing" | "reconnect", handshake: Handshake, options: SessionOptions & {
|
|
204
|
+
acceptEphemeral?: ResponderOptions["acceptEphemeral"];
|
|
205
|
+
resume?: boolean;
|
|
206
|
+
});
|
|
207
|
+
get state(): SessionState;
|
|
208
|
+
/**
|
|
209
|
+
* A reconnect that carried on from the last transport: nothing was lost.
|
|
210
|
+
* False after a pairing, or a reconnect that started again from stream 1,
|
|
211
|
+
* when the browser must load the session afresh. Set before
|
|
212
|
+
* `onConfirmed` and `onKeyConfirmed` run.
|
|
213
|
+
*/
|
|
214
|
+
get resumed(): boolean;
|
|
215
|
+
/** The SAS words and handshake hash, once the handshake is done (and, on the agent side, the keys confirmed). */
|
|
216
|
+
get handshakeInfo(): HandshakeInfo | undefined;
|
|
217
|
+
/** Initiator: sends message 1. */
|
|
218
|
+
start(): void;
|
|
219
|
+
/**
|
|
220
|
+
* Responder: the user confirmed the SAS words. Sends CONFIRMED, and lets
|
|
221
|
+
* ACP messages through from now on.
|
|
222
|
+
*/
|
|
223
|
+
confirm(): void;
|
|
224
|
+
/** Sends one ACP message (a JSON-RPC 2.0 message, as text). */
|
|
225
|
+
send(message: string): void;
|
|
226
|
+
private sendStream;
|
|
227
|
+
/**
|
|
228
|
+
* Initiator, after a pairing: sends REMEMBER with the public half of the
|
|
229
|
+
* static key it will reconnect with. Once, as soon as CONFIRMED has come,
|
|
230
|
+
* before any ACP message.
|
|
231
|
+
*/
|
|
232
|
+
remember(publicKey: Uint8Array): void;
|
|
233
|
+
ping(payload?: Uint8Array): void;
|
|
234
|
+
/** Ends the session with an authenticated CLOSE. */
|
|
235
|
+
close(reason?: string): void;
|
|
236
|
+
/** The socket ended. Without an authenticated CLOSE first, the connection was lost. */
|
|
237
|
+
transportClosed(reason?: string): void;
|
|
238
|
+
/** Takes one binary message from the relay socket. */
|
|
239
|
+
receive(data: Uint8Array): void;
|
|
240
|
+
/**
|
|
241
|
+
* Runs one step. A step that waits on a DH holds back what arrives
|
|
242
|
+
* meanwhile, which then runs in order.
|
|
243
|
+
*/
|
|
244
|
+
private run;
|
|
245
|
+
private resume;
|
|
246
|
+
/** Protocol errors end the session; others are bugs, thrown when they can be. */
|
|
247
|
+
private failOn;
|
|
248
|
+
private receiveUnsafe;
|
|
249
|
+
private receiveHandshake;
|
|
250
|
+
/** Message 2 is written (responder, `reply`) or read (initiator). */
|
|
251
|
+
private handshakeDone;
|
|
252
|
+
private receiveTransport;
|
|
253
|
+
private handleFrame;
|
|
254
|
+
/**
|
|
255
|
+
* Responder, reconnecting: the browser's first PING has decrypted. Its
|
|
256
|
+
* payload, if any, is the last stream it received. Answers CONFIRMED with
|
|
257
|
+
* the last stream received here, then sends again what the browser
|
|
258
|
+
* missed; or, if that can't be done, an empty CONFIRMED, and both sides
|
|
259
|
+
* start again from stream 1.
|
|
260
|
+
*/
|
|
261
|
+
private openReconnect;
|
|
262
|
+
/** Initiator, reconnecting: the agent side's CONFIRMED. */
|
|
263
|
+
private confirmReconnect;
|
|
264
|
+
private restart;
|
|
265
|
+
private sendFrame;
|
|
266
|
+
private fail;
|
|
267
|
+
private finish;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* The browser's end: no static key, the agent side's key and the psk from
|
|
271
|
+
* the link. Call `start` once the relay says `ready`.
|
|
272
|
+
*/
|
|
273
|
+
export declare function initiator(options: InitiatorOptions): RelaySession;
|
|
274
|
+
/**
|
|
275
|
+
* The agent side's end, with its static key and the link's psk. It answers
|
|
276
|
+
* message 1 when it arrives.
|
|
277
|
+
*/
|
|
278
|
+
export declare function responder(options: ResponderOptions): RelaySession;
|
|
279
|
+
/**
|
|
280
|
+
* A remembered browser's end of a reconnect (Noise KK): its own static key,
|
|
281
|
+
* and the agent side's from the link it paired with. Call `start` once the
|
|
282
|
+
* relay says `ready`.
|
|
283
|
+
*/
|
|
284
|
+
export declare function reconnectInitiator(options: ReconnectInitiatorOptions): RelaySession;
|
|
285
|
+
/**
|
|
286
|
+
* The agent side's end of a reconnect, with the key the browser sent in
|
|
287
|
+
* REMEMBER. It answers message 1 when it arrives, and opens by itself once
|
|
288
|
+
* the keys are confirmed.
|
|
289
|
+
*/
|
|
290
|
+
export declare function reconnectResponder(options: ReconnectResponderOptions): RelaySession;
|
|
291
|
+
/** Remembers the ephemeral keys seen while a link is valid, to refuse replays of message 1. */
|
|
292
|
+
export declare class EphemeralCache {
|
|
293
|
+
private readonly seen;
|
|
294
|
+
/** Returns false if `key` was seen before; otherwise remembers it. */
|
|
295
|
+
accept: (key: Uint8Array) => boolean;
|
|
296
|
+
}
|
|
297
|
+
export {};
|
|
298
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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