@noble/post-quantum 0.5.3 → 0.6.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/README.md +70 -39
- package/_crystals.d.ts +84 -0
- package/_crystals.d.ts.map +1 -1
- package/_crystals.js +64 -3
- package/_crystals.js.map +1 -1
- package/falcon.d.ts +84 -0
- package/falcon.d.ts.map +1 -0
- package/falcon.js +2378 -0
- package/falcon.js.map +1 -0
- package/hybrid.d.ts +181 -5
- package/hybrid.d.ts.map +1 -1
- package/hybrid.js +375 -53
- package/hybrid.js.map +1 -1
- package/ml-dsa.d.ts +22 -1
- package/ml-dsa.d.ts.map +1 -1
- package/ml-dsa.js +101 -51
- package/ml-dsa.js.map +1 -1
- package/ml-kem.d.ts +27 -3
- package/ml-kem.d.ts.map +1 -1
- package/ml-kem.js +154 -52
- package/ml-kem.js.map +1 -1
- package/package.json +12 -5
- package/slh-dsa.d.ts +116 -13
- package/slh-dsa.d.ts.map +1 -1
- package/slh-dsa.js +134 -35
- package/slh-dsa.js.map +1 -1
- package/src/_crystals.ts +101 -7
- package/src/falcon.ts +2470 -0
- package/src/hybrid.ts +406 -72
- package/src/ml-dsa.ts +144 -74
- package/src/ml-kem.ts +168 -54
- package/src/slh-dsa.ts +203 -44
- package/src/utils.ts +320 -15
- package/utils.d.ts +283 -4
- package/utils.d.ts.map +1 -1
- package/utils.js +245 -14
- package/utils.js.map +1 -1
package/utils.js
CHANGED
|
@@ -3,11 +3,57 @@
|
|
|
3
3
|
* @module
|
|
4
4
|
*/
|
|
5
5
|
/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */
|
|
6
|
-
import { abytes, abytes as abytes_, concatBytes,
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { abytes, abytes as abytes_, concatBytes, isLE, randomBytes as randb, } from '@noble/hashes/utils.js';
|
|
7
|
+
/**
|
|
8
|
+
* Asserts that a value is a byte array and optionally checks its length.
|
|
9
|
+
* Returns the original reference unchanged on success, and currently also accepts Node `Buffer`
|
|
10
|
+
* values through the upstream validator.
|
|
11
|
+
* This helper throws on malformed input, so APIs that must return `false` need to guard lengths
|
|
12
|
+
* before decoding or before calling it.
|
|
13
|
+
* @example
|
|
14
|
+
* Validate that a value is a byte array with the expected length.
|
|
15
|
+
* ```ts
|
|
16
|
+
* abytes(new Uint8Array([1]), 1);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
const abytesDoc = abytes;
|
|
20
|
+
export { abytesDoc as abytes };
|
|
21
|
+
/**
|
|
22
|
+
* Concatenates byte arrays into a new `Uint8Array`.
|
|
23
|
+
* Zero arguments return an empty `Uint8Array`.
|
|
24
|
+
* Invalid segments throw before allocation because each argument is validated first.
|
|
25
|
+
* @example
|
|
26
|
+
* Concatenate two byte arrays into one result.
|
|
27
|
+
* ```ts
|
|
28
|
+
* concatBytes(new Uint8Array([1]), new Uint8Array([2]));
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
const concatBytesDoc = concatBytes;
|
|
32
|
+
export { concatBytesDoc as concatBytes };
|
|
33
|
+
/**
|
|
34
|
+
* Returns cryptographically secure random bytes.
|
|
35
|
+
* Requires `globalThis.crypto.getRandomValues` and throws if that API is unavailable.
|
|
36
|
+
* `bytesLength` is validated by the upstream helper as a non-negative integer before allocation,
|
|
37
|
+
* so negative and fractional values both throw instead of truncating through JS `ToIndex`.
|
|
38
|
+
* @example
|
|
39
|
+
* Generate a fresh random seed.
|
|
40
|
+
* ```ts
|
|
41
|
+
* const seed = randomBytes(4);
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
9
44
|
export const randomBytes = randb;
|
|
10
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Compares two byte arrays in a length-constant way for equal lengths.
|
|
47
|
+
* Unequal lengths return `false` immediately, and there is no runtime type validation.
|
|
48
|
+
* @param a - First byte array.
|
|
49
|
+
* @param b - Second byte array.
|
|
50
|
+
* @returns Whether both arrays contain the same bytes.
|
|
51
|
+
* @example
|
|
52
|
+
* Compare two byte arrays for equality.
|
|
53
|
+
* ```ts
|
|
54
|
+
* equalBytes(new Uint8Array([1]), new Uint8Array([1]));
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
11
57
|
export function equalBytes(a, b) {
|
|
12
58
|
if (a.length !== b.length)
|
|
13
59
|
return false;
|
|
@@ -16,25 +62,113 @@ export function equalBytes(a, b) {
|
|
|
16
62
|
diff |= a[i] ^ b[i];
|
|
17
63
|
return diff === 0;
|
|
18
64
|
}
|
|
19
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Copies bytes into a fresh `Uint8Array`.
|
|
67
|
+
* Returns a detached plain `Uint8Array`, and currently accepts broader array-like / iterable
|
|
68
|
+
* inputs because it delegates directly to `Uint8Array.from(...)`.
|
|
69
|
+
* @param bytes - Source bytes.
|
|
70
|
+
* @returns Copy of the input bytes.
|
|
71
|
+
* @example
|
|
72
|
+
* Copy bytes into a fresh array.
|
|
73
|
+
* ```ts
|
|
74
|
+
* copyBytes(new Uint8Array([1, 2]));
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
20
77
|
export function copyBytes(bytes) {
|
|
21
78
|
return Uint8Array.from(bytes);
|
|
22
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Byte-swaps each 64-bit lane in place.
|
|
82
|
+
* Falcon's exact binary64 tables are stored as little-endian byte payloads, so BE runtimes need
|
|
83
|
+
* this boundary helper before aliasing them as host `Float64Array` lanes.
|
|
84
|
+
* @param arr - Byte buffer whose length is a multiple of 8.
|
|
85
|
+
* @returns The same buffer after in-place 64-bit lane byte swaps.
|
|
86
|
+
*/
|
|
87
|
+
export function byteSwap64(arr) {
|
|
88
|
+
const bytes = new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
89
|
+
for (let i = 0; i < bytes.length; i += 8) {
|
|
90
|
+
const a0 = bytes[i + 0];
|
|
91
|
+
const a1 = bytes[i + 1];
|
|
92
|
+
const a2 = bytes[i + 2];
|
|
93
|
+
const a3 = bytes[i + 3];
|
|
94
|
+
bytes[i + 0] = bytes[i + 7];
|
|
95
|
+
bytes[i + 1] = bytes[i + 6];
|
|
96
|
+
bytes[i + 2] = bytes[i + 5];
|
|
97
|
+
bytes[i + 3] = bytes[i + 4];
|
|
98
|
+
bytes[i + 4] = a3;
|
|
99
|
+
bytes[i + 5] = a2;
|
|
100
|
+
bytes[i + 6] = a1;
|
|
101
|
+
bytes[i + 7] = a0;
|
|
102
|
+
}
|
|
103
|
+
return arr;
|
|
104
|
+
}
|
|
105
|
+
export const baswap64If = isLE
|
|
106
|
+
? (arr) => arr
|
|
107
|
+
: byteSwap64;
|
|
108
|
+
/**
|
|
109
|
+
* Validates that an options bag is a plain object.
|
|
110
|
+
* @param opts - Options object to validate.
|
|
111
|
+
* @throws On wrong argument types. {@link TypeError}
|
|
112
|
+
* @example
|
|
113
|
+
* Validate that an options bag is a plain object.
|
|
114
|
+
* ```ts
|
|
115
|
+
* validateOpts({});
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
23
118
|
export function validateOpts(opts) {
|
|
24
|
-
//
|
|
25
|
-
if (
|
|
26
|
-
throw new
|
|
119
|
+
// Arrays silently passed here before, but these call sites expect named option-bag fields.
|
|
120
|
+
if (Object.prototype.toString.call(opts) !== '[object Object]')
|
|
121
|
+
throw new TypeError('expected valid options object');
|
|
27
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Validates common verification options.
|
|
125
|
+
* `context` itself is validated with `abytes(...)`, and individual algorithms may narrow support
|
|
126
|
+
* further after this shared plain-object gate.
|
|
127
|
+
* @param opts - Verification options. See {@link VerOpts}.
|
|
128
|
+
* @throws On wrong argument types. {@link TypeError}
|
|
129
|
+
* @example
|
|
130
|
+
* Validate common verification options.
|
|
131
|
+
* ```ts
|
|
132
|
+
* validateVerOpts({ context: new Uint8Array([1]) });
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
28
135
|
export function validateVerOpts(opts) {
|
|
29
136
|
validateOpts(opts);
|
|
30
137
|
if (opts.context !== undefined)
|
|
31
138
|
abytes(opts.context, undefined, 'opts.context');
|
|
32
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Validates common signing options.
|
|
142
|
+
* `extraEntropy` is validated with `abytes(...)`; exact lengths and extra algorithm-specific
|
|
143
|
+
* restrictions are enforced later by callers.
|
|
144
|
+
* @param opts - Signing options. See {@link SigOpts}.
|
|
145
|
+
* @throws On wrong argument types. {@link TypeError}
|
|
146
|
+
* @example
|
|
147
|
+
* Validate common signing options.
|
|
148
|
+
* ```ts
|
|
149
|
+
* validateSigOpts({ extraEntropy: new Uint8Array([1]) });
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
33
152
|
export function validateSigOpts(opts) {
|
|
34
153
|
validateVerOpts(opts);
|
|
35
154
|
if (opts.extraEntropy !== false && opts.extraEntropy !== undefined)
|
|
36
155
|
abytes(opts.extraEntropy, undefined, 'opts.extraEntropy');
|
|
37
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Builds a fixed-layout coder from byte lengths and nested coders.
|
|
159
|
+
* Raw-length fields decode as zero-copy `subarray(...)` views, and nested coders may preserve that
|
|
160
|
+
* aliasing too. Nested coder `encode(...)` results are treated as owned scratch: `splitCoder`
|
|
161
|
+
* copies them into the output and then zeroizes them with `fill(0)`. If a nested encoder forwards
|
|
162
|
+
* caller-owned bytes, it must do so only after detaching them into a disposable copy.
|
|
163
|
+
* @param label - Label used in validation errors.
|
|
164
|
+
* @param lengths - Field lengths or nested coders.
|
|
165
|
+
* @returns Composite fixed-length coder.
|
|
166
|
+
* @example
|
|
167
|
+
* Build a fixed-layout coder from byte lengths and nested coders.
|
|
168
|
+
* ```ts
|
|
169
|
+
* splitCoder('demo', 1, 2).encode([new Uint8Array([1]), new Uint8Array([2, 3])]);
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
38
172
|
export function splitCoder(label, ...lengths) {
|
|
39
173
|
const getLength = (c) => (typeof c === 'number' ? c : c.bytesLen);
|
|
40
174
|
const bytesLen = lengths.reduce((sum, a) => sum + getLength(a), 0);
|
|
@@ -68,13 +202,32 @@ export function splitCoder(label, ...lengths) {
|
|
|
68
202
|
};
|
|
69
203
|
}
|
|
70
204
|
// nano-packed.array (fixed size)
|
|
205
|
+
/**
|
|
206
|
+
* Builds a fixed-length vector coder from another fixed-length coder.
|
|
207
|
+
* Element decoding receives `subarray(...)` views, so aliasing depends on the element coder.
|
|
208
|
+
* Element coder `encode(...)` results are treated as owned scratch: `vecCoder` copies them into
|
|
209
|
+
* the output and then zeroizes them with `fill(0)`. If an element encoder forwards caller-owned
|
|
210
|
+
* bytes, it must do so only after detaching them into a disposable copy. `vecCoder` also trusts
|
|
211
|
+
* the `BytesCoderLen` contract: each encoded element must already be exactly `c.bytesLen` bytes.
|
|
212
|
+
* @param c - Element coder.
|
|
213
|
+
* @param vecLen - Number of elements in the vector.
|
|
214
|
+
* @returns Fixed-length vector coder.
|
|
215
|
+
* @example
|
|
216
|
+
* Build a fixed-length vector coder from another fixed-length coder.
|
|
217
|
+
* ```ts
|
|
218
|
+
* vecCoder(
|
|
219
|
+
* { bytesLen: 1, encode: (n: number) => Uint8Array.of(n), decode: (b: Uint8Array) => b[0] || 0 },
|
|
220
|
+
* 2
|
|
221
|
+
* ).encode([1, 2]);
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
71
224
|
export function vecCoder(c, vecLen) {
|
|
72
225
|
const bytesLen = vecLen * c.bytesLen;
|
|
73
226
|
return {
|
|
74
227
|
bytesLen,
|
|
75
228
|
encode: (u) => {
|
|
76
229
|
if (u.length !== vecLen)
|
|
77
|
-
throw new
|
|
230
|
+
throw new RangeError(`vecCoder.encode: wrong length=${u.length}. Expected: ${vecLen}`);
|
|
78
231
|
const res = new Uint8Array(bytesLen);
|
|
79
232
|
for (let i = 0, pos = 0; i < u.length; i++) {
|
|
80
233
|
const b = c.encode(u[i]);
|
|
@@ -93,7 +246,17 @@ export function vecCoder(c, vecLen) {
|
|
|
93
246
|
},
|
|
94
247
|
};
|
|
95
248
|
}
|
|
96
|
-
|
|
249
|
+
/**
|
|
250
|
+
* Overwrites supported typed-array inputs with zeroes in place.
|
|
251
|
+
* Accepts direct typed arrays and one-level arrays of them.
|
|
252
|
+
* @param list - Typed arrays or one-level lists of typed arrays to clear.
|
|
253
|
+
* @example
|
|
254
|
+
* Overwrite typed arrays with zeroes.
|
|
255
|
+
* ```ts
|
|
256
|
+
* const buf = Uint8Array.of(1, 2, 3);
|
|
257
|
+
* cleanBytes(buf);
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
97
260
|
export function cleanBytes(...list) {
|
|
98
261
|
for (const t of list) {
|
|
99
262
|
if (Array.isArray(t))
|
|
@@ -103,22 +266,72 @@ export function cleanBytes(...list) {
|
|
|
103
266
|
t.fill(0);
|
|
104
267
|
}
|
|
105
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* Creates a 32-bit mask with the lowest `bits` bits set.
|
|
271
|
+
* @param bits - Number of low bits to keep.
|
|
272
|
+
* @returns Bit mask with `bits` ones.
|
|
273
|
+
* @example
|
|
274
|
+
* Create a low-bit mask for packed-field operations.
|
|
275
|
+
* ```ts
|
|
276
|
+
* const mask = getMask(4);
|
|
277
|
+
* ```
|
|
278
|
+
*/
|
|
106
279
|
export function getMask(bits) {
|
|
107
|
-
|
|
280
|
+
if (!Number.isSafeInteger(bits) || bits < 0 || bits > 32)
|
|
281
|
+
throw new RangeError(`expected bits in [0..32], got ${bits}`);
|
|
282
|
+
// JS shifts are modulo 32, so bit 32 needs an explicit full-width mask.
|
|
283
|
+
return bits === 32 ? 0xffffffff : ~(-1 << bits) >>> 0;
|
|
108
284
|
}
|
|
109
|
-
|
|
285
|
+
/** Shared empty byte array used as the default context. */
|
|
286
|
+
export const EMPTY = /* @__PURE__ */ Uint8Array.of();
|
|
287
|
+
/**
|
|
288
|
+
* Builds the domain-separated message payload for the pure sign/verify paths.
|
|
289
|
+
* Context length `255` is valid; only `ctx.length > 255` is rejected.
|
|
290
|
+
* @param msg - Message bytes.
|
|
291
|
+
* @param ctx - Optional context bytes.
|
|
292
|
+
* @returns Domain-separated message payload.
|
|
293
|
+
* @throws On wrong argument ranges or values. {@link RangeError}
|
|
294
|
+
* @example
|
|
295
|
+
* Build the domain-separated payload before direct signing.
|
|
296
|
+
* ```ts
|
|
297
|
+
* const payload = getMessage(new Uint8Array([1, 2]));
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
110
300
|
export function getMessage(msg, ctx = EMPTY) {
|
|
111
301
|
abytes_(msg);
|
|
112
302
|
abytes_(ctx);
|
|
113
303
|
if (ctx.length > 255)
|
|
114
|
-
throw new
|
|
304
|
+
throw new RangeError('context should be 255 bytes or less');
|
|
115
305
|
return concatBytes(new Uint8Array([0, ctx.length]), ctx, msg);
|
|
116
306
|
}
|
|
307
|
+
// DER tag+length plus the shared NIST hash OID arc 2.16.840.1.101.3.4.2.* used by the
|
|
308
|
+
// FIPS 204 / FIPS 205 pre-hash wrappers; the final byte selects SHA-256, SHA-512, SHAKE128,
|
|
309
|
+
// SHAKE256, or another approved hash/XOF under that subtree.
|
|
117
310
|
// 06 09 60 86 48 01 65 03 04 02
|
|
118
311
|
const oidNistP = /* @__PURE__ */ Uint8Array.from([6, 9, 0x60, 0x86, 0x48, 1, 0x65, 3, 4, 2]);
|
|
312
|
+
/**
|
|
313
|
+
* Validates that a hash exposes a NIST hash OID and enough collision resistance.
|
|
314
|
+
* Current accepted surface is broader than the FIPS algorithm tables: any hash/XOF under the NIST
|
|
315
|
+
* `2.16.840.1.101.3.4.2.*` subtree is accepted if its effective `outputLen` is strong enough.
|
|
316
|
+
* XOF callers must pass a callable whose `outputLen` matches the digest length they actually intend
|
|
317
|
+
* to sign; bare `shake128` / `shake256` defaults are too short for the stronger prehash modes.
|
|
318
|
+
* @param hash - Hash function to validate.
|
|
319
|
+
* @param requiredStrength - Minimum required collision-resistance strength in bits.
|
|
320
|
+
* @throws If the hash metadata or collision resistance is insufficient. {@link Error}
|
|
321
|
+
* @example
|
|
322
|
+
* Validate that a hash exposes a NIST hash OID and enough collision resistance.
|
|
323
|
+
* ```ts
|
|
324
|
+
* import { sha256 } from '@noble/hashes/sha2.js';
|
|
325
|
+
* import { checkHash } from '@noble/post-quantum/utils.js';
|
|
326
|
+
* checkHash(sha256, 128);
|
|
327
|
+
* ```
|
|
328
|
+
*/
|
|
119
329
|
export function checkHash(hash, requiredStrength = 0) {
|
|
120
330
|
if (!hash.oid || !equalBytes(hash.oid.subarray(0, 10), oidNistP))
|
|
121
331
|
throw new Error('hash.oid is invalid: expected NIST hash');
|
|
332
|
+
// FIPS 204 / FIPS 205 require both collision and second-preimage strength; for approved NIST
|
|
333
|
+
// hashes/XOFs under this OID subtree, the collision bound from the configured digest length is
|
|
334
|
+
// the tighter runtime check, so enforce that lower bound here.
|
|
122
335
|
const collisionResistance = (hash.outputLen * 8) / 2;
|
|
123
336
|
if (requiredStrength > collisionResistance) {
|
|
124
337
|
throw new Error('Pre-hash security strength too low: ' +
|
|
@@ -127,11 +340,29 @@ export function checkHash(hash, requiredStrength = 0) {
|
|
|
127
340
|
requiredStrength);
|
|
128
341
|
}
|
|
129
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* Builds the domain-separated prehash payload for the prehash sign/verify paths.
|
|
345
|
+
* Callers are expected to vet `hash.oid` first, e.g. via `checkHash(...)`; calling this helper
|
|
346
|
+
* directly with a hash object that lacks `oid` currently throws later inside `concatBytes(...)`.
|
|
347
|
+
* Context length `255` is valid; only `ctx.length > 255` is rejected.
|
|
348
|
+
* @param hash - Prehash function.
|
|
349
|
+
* @param msg - Message bytes.
|
|
350
|
+
* @param ctx - Optional context bytes.
|
|
351
|
+
* @returns Domain-separated prehash payload.
|
|
352
|
+
* @throws On wrong argument ranges or values. {@link RangeError}
|
|
353
|
+
* @example
|
|
354
|
+
* Build the domain-separated prehash payload for external hashing.
|
|
355
|
+
* ```ts
|
|
356
|
+
* import { sha256 } from '@noble/hashes/sha2.js';
|
|
357
|
+
* import { getMessagePrehash } from '@noble/post-quantum/utils.js';
|
|
358
|
+
* getMessagePrehash(sha256, new Uint8Array([1, 2]));
|
|
359
|
+
* ```
|
|
360
|
+
*/
|
|
130
361
|
export function getMessagePrehash(hash, msg, ctx = EMPTY) {
|
|
131
362
|
abytes_(msg);
|
|
132
363
|
abytes_(ctx);
|
|
133
364
|
if (ctx.length > 255)
|
|
134
|
-
throw new
|
|
365
|
+
throw new RangeError('context should be 255 bytes or less');
|
|
135
366
|
const hashed = hash(msg);
|
|
136
367
|
return concatBytes(new Uint8Array([1, ctx.length]), ctx, hash.oid, hashed);
|
|
137
368
|
}
|
package/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,4EAA4E;AAC5E,OAAO,EAGL,MAAM,EACN,MAAM,IAAI,OAAO,EACjB,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,4EAA4E;AAC5E,OAAO,EAGL,MAAM,EACN,MAAM,IAAI,OAAO,EACjB,WAAW,EACX,IAAI,EACJ,WAAW,IAAI,KAAK,GACrB,MAAM,wBAAwB,CAAC;AAChC;;;;;;;;;;;GAWG;AACH,MAAM,SAAS,GAAkB,MAAM,CAAC;AACxC,OAAO,EAAE,SAAS,IAAI,MAAM,EAAE,CAAC;AAC/B;;;;;;;;;GASG;AACH,MAAM,cAAc,GAAuB,WAAW,CAAC;AACvD,OAAO,EAAE,cAAc,IAAI,WAAW,EAAE,CAAC;AACzC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,WAAW,GAAiB,KAAK,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CAAC,CAAa,EAAE,CAAa;IACrD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,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