@bcts/frost-hubert 1.0.0-alpha.17
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 +48 -0
- package/README.md +35 -0
- package/dist/bin/frost.cjs +109 -0
- package/dist/bin/frost.cjs.map +1 -0
- package/dist/bin/frost.d.cts +1 -0
- package/dist/bin/frost.d.mts +1 -0
- package/dist/bin/frost.mjs +109 -0
- package/dist/bin/frost.mjs.map +1 -0
- package/dist/chunk-CQwRTUmo.cjs +53 -0
- package/dist/chunk-D3JzZLW2.mjs +21 -0
- package/dist/cmd/index.cjs +45 -0
- package/dist/cmd/index.d.cts +4 -0
- package/dist/cmd/index.d.mts +4 -0
- package/dist/cmd/index.mjs +7 -0
- package/dist/cmd-C8pmNd28.mjs +4664 -0
- package/dist/cmd-C8pmNd28.mjs.map +1 -0
- package/dist/cmd-CxUgryx_.cjs +4803 -0
- package/dist/cmd-CxUgryx_.cjs.map +1 -0
- package/dist/dkg/index.cjs +7 -0
- package/dist/dkg/index.d.cts +2 -0
- package/dist/dkg/index.d.mts +2 -0
- package/dist/dkg/index.mjs +3 -0
- package/dist/dkg-D4RcblWl.cjs +364 -0
- package/dist/dkg-D4RcblWl.cjs.map +1 -0
- package/dist/dkg-DqGrAV81.mjs +334 -0
- package/dist/dkg-DqGrAV81.mjs.map +1 -0
- package/dist/frost/index.cjs +37 -0
- package/dist/frost/index.d.cts +207 -0
- package/dist/frost/index.d.cts.map +1 -0
- package/dist/frost/index.d.mts +207 -0
- package/dist/frost/index.d.mts.map +1 -0
- package/dist/frost/index.mjs +3 -0
- package/dist/frost-CMH1K0Cw.cjs +511 -0
- package/dist/frost-CMH1K0Cw.cjs.map +1 -0
- package/dist/frost-Csp0IOrd.mjs +326 -0
- package/dist/frost-Csp0IOrd.mjs.map +1 -0
- package/dist/index-BGVoWW5P.d.cts +172 -0
- package/dist/index-BGVoWW5P.d.cts.map +1 -0
- package/dist/index-BJeUYrdE.d.mts +396 -0
- package/dist/index-BJeUYrdE.d.mts.map +1 -0
- package/dist/index-ByMDUYKw.d.mts +1098 -0
- package/dist/index-ByMDUYKw.d.mts.map +1 -0
- package/dist/index-DejLkr_F.d.mts +172 -0
- package/dist/index-DejLkr_F.d.mts.map +1 -0
- package/dist/index-Dib1OE-e.d.cts +1098 -0
- package/dist/index-Dib1OE-e.d.cts.map +1 -0
- package/dist/index-DnvBKgec.d.cts +396 -0
- package/dist/index-DnvBKgec.d.cts.map +1 -0
- package/dist/index.cjs +85 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +15 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +15 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -0
- package/dist/registry/index.cjs +13 -0
- package/dist/registry/index.d.cts +2 -0
- package/dist/registry/index.d.mts +2 -0
- package/dist/registry/index.mjs +3 -0
- package/dist/registry-CBjRRqNv.mjs +144 -0
- package/dist/registry-CBjRRqNv.mjs.map +1 -0
- package/dist/registry-CWp2amuo.mjs +789 -0
- package/dist/registry-CWp2amuo.mjs.map +1 -0
- package/dist/registry-D5yh293y.cjs +857 -0
- package/dist/registry-D5yh293y.cjs.map +1 -0
- package/dist/registry-DNUNW6SH.cjs +163 -0
- package/dist/registry-DNUNW6SH.cjs.map +1 -0
- package/package.json +119 -0
- package/src/bin/frost.ts +218 -0
- package/src/cmd/busy.ts +64 -0
- package/src/cmd/check.ts +20 -0
- package/src/cmd/common.ts +40 -0
- package/src/cmd/dkg/common.ts +275 -0
- package/src/cmd/dkg/coordinator/finalize.ts +592 -0
- package/src/cmd/dkg/coordinator/index.ts +12 -0
- package/src/cmd/dkg/coordinator/invite.ts +217 -0
- package/src/cmd/dkg/coordinator/round1.ts +889 -0
- package/src/cmd/dkg/coordinator/round2.ts +959 -0
- package/src/cmd/dkg/index.ts +11 -0
- package/src/cmd/dkg/participant/finalize.ts +575 -0
- package/src/cmd/dkg/participant/index.ts +12 -0
- package/src/cmd/dkg/participant/receive.ts +348 -0
- package/src/cmd/dkg/participant/round1.ts +464 -0
- package/src/cmd/dkg/participant/round2.ts +627 -0
- package/src/cmd/index.ts +18 -0
- package/src/cmd/parallel.ts +334 -0
- package/src/cmd/registry/index.ts +88 -0
- package/src/cmd/registry/owner/index.ts +9 -0
- package/src/cmd/registry/owner/set.ts +70 -0
- package/src/cmd/registry/participant/add.ts +70 -0
- package/src/cmd/registry/participant/index.ts +9 -0
- package/src/cmd/sign/common.ts +108 -0
- package/src/cmd/sign/coordinator/index.ts +11 -0
- package/src/cmd/sign/coordinator/invite.ts +431 -0
- package/src/cmd/sign/coordinator/round1.ts +751 -0
- package/src/cmd/sign/coordinator/round2.ts +836 -0
- package/src/cmd/sign/index.ts +11 -0
- package/src/cmd/sign/participant/finalize.ts +823 -0
- package/src/cmd/sign/participant/index.ts +12 -0
- package/src/cmd/sign/participant/receive.ts +378 -0
- package/src/cmd/sign/participant/round1.ts +479 -0
- package/src/cmd/sign/participant/round2.ts +748 -0
- package/src/cmd/storage.ts +116 -0
- package/src/dkg/group-invite.ts +414 -0
- package/src/dkg/index.ts +10 -0
- package/src/dkg/proposed-participant.ts +132 -0
- package/src/frost/index.ts +456 -0
- package/src/index.ts +45 -0
- package/src/registry/group-record.ts +392 -0
- package/src/registry/index.ts +12 -0
- package/src/registry/owner-record.ts +146 -0
- package/src/registry/participant-record.ts +186 -0
- package/src/registry/registry-impl.ts +364 -0
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-CQwRTUmo.cjs');
|
|
2
|
+
let _frosts_ed25519 = require("@frosts/ed25519");
|
|
3
|
+
let _frosts_core = require("@frosts/core");
|
|
4
|
+
|
|
5
|
+
//#region src/frost/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* FROST cryptographic operations module.
|
|
8
|
+
*
|
|
9
|
+
* This module wraps the @frosts/ed25519 library to provide FROST
|
|
10
|
+
* threshold signature operations for DKG and signing.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
var frost_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
15
|
+
Ed25519Sha512: () => _frosts_ed25519.Ed25519Sha512,
|
|
16
|
+
Identifier: () => _frosts_ed25519.Identifier,
|
|
17
|
+
SecureRng: () => SecureRng,
|
|
18
|
+
aggregateSignatures: () => aggregateSignatures,
|
|
19
|
+
bytesToHex: () => bytesToHex,
|
|
20
|
+
createRng: () => createRng,
|
|
21
|
+
createSigningPackage: () => createSigningPackage,
|
|
22
|
+
deserializeDkgRound1Package: () => deserializeDkgRound1Package,
|
|
23
|
+
deserializeDkgRound2Package: () => deserializeDkgRound2Package,
|
|
24
|
+
deserializeIdentifier: () => deserializeIdentifier,
|
|
25
|
+
deserializeKeyPackage: () => deserializeKeyPackage,
|
|
26
|
+
deserializePublicKeyPackage: () => deserializePublicKeyPackage,
|
|
27
|
+
deserializeSignatureShare: () => deserializeSignatureShare,
|
|
28
|
+
deserializeSigningCommitments: () => deserializeSigningCommitments,
|
|
29
|
+
dkgPart1: () => dkgPart1,
|
|
30
|
+
dkgPart2: () => dkgPart2,
|
|
31
|
+
dkgPart3: () => dkgPart3,
|
|
32
|
+
hexToBytes: () => hexToBytes,
|
|
33
|
+
identifierFromU16: () => identifierFromU16,
|
|
34
|
+
identifierToHex: () => identifierToHex,
|
|
35
|
+
keys: () => _frosts_ed25519.keys,
|
|
36
|
+
serializeDkgRound1Package: () => serializeDkgRound1Package,
|
|
37
|
+
serializeDkgRound2Package: () => serializeDkgRound2Package,
|
|
38
|
+
serializeIdentifier: () => serializeIdentifier,
|
|
39
|
+
serializeKeyPackage: () => serializeKeyPackage,
|
|
40
|
+
serializePublicKeyPackage: () => serializePublicKeyPackage,
|
|
41
|
+
serializeSignature: () => serializeSignature,
|
|
42
|
+
serializeSignatureHex: () => serializeSignatureHex,
|
|
43
|
+
serializeSignatureShare: () => serializeSignatureShare,
|
|
44
|
+
serializeSigningCommitments: () => serializeSigningCommitments,
|
|
45
|
+
serializeSigningNonces: () => serializeSigningNonces,
|
|
46
|
+
signingRound1: () => signingRound1,
|
|
47
|
+
signingRound2: () => signingRound2
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* Cryptographically secure random number generator using Web Crypto API.
|
|
51
|
+
*/
|
|
52
|
+
var SecureRng = class {
|
|
53
|
+
fill(array) {
|
|
54
|
+
globalThis.crypto.getRandomValues(array);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Create a new secure random number generator.
|
|
59
|
+
*/
|
|
60
|
+
function createRng() {
|
|
61
|
+
return new SecureRng();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create an identifier from a number (1-indexed participant ID).
|
|
65
|
+
*/
|
|
66
|
+
function identifierFromU16(id) {
|
|
67
|
+
return _frosts_ed25519.Identifier.fromU16(_frosts_ed25519.Ed25519Sha512, id);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Serialize an identifier to bytes.
|
|
71
|
+
*/
|
|
72
|
+
function serializeIdentifier(id) {
|
|
73
|
+
return id.serialize();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Deserialize an identifier from bytes.
|
|
77
|
+
*/
|
|
78
|
+
function deserializeIdentifier(bytes) {
|
|
79
|
+
return _frosts_ed25519.Identifier.deserialize(_frosts_ed25519.Ed25519Sha512, bytes);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Convert an identifier to a hex string for use as a map key.
|
|
83
|
+
*/
|
|
84
|
+
function identifierToHex(id) {
|
|
85
|
+
return bytesToHex(id.serialize());
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Execute DKG round 1 (part1) - Generate commitment and proof of knowledge.
|
|
89
|
+
*
|
|
90
|
+
* @param identifier - This participant's identifier
|
|
91
|
+
* @param maxSigners - Total number of participants
|
|
92
|
+
* @param minSigners - Threshold (minimum signers required)
|
|
93
|
+
* @param rng - Random number generator
|
|
94
|
+
* @returns Tuple of [SecretPackage, Package] where Package is broadcast to all
|
|
95
|
+
*/
|
|
96
|
+
function dkgPart1(identifier, maxSigners, minSigners, rng = createRng()) {
|
|
97
|
+
return _frosts_ed25519.keys.dkg.part1(_frosts_ed25519.Ed25519Sha512, identifier, maxSigners, minSigners, rng);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Execute DKG round 2 (part2) - Process round 1 packages and generate shares.
|
|
101
|
+
*
|
|
102
|
+
* @param secretPackage - The secret package from part1
|
|
103
|
+
* @param round1Packages - Map of identifier hex to round1 packages from other participants
|
|
104
|
+
* @returns Tuple of [Round2SecretPackage, Map of round2 packages to send]
|
|
105
|
+
*/
|
|
106
|
+
function dkgPart2(secretPackage, round1Packages) {
|
|
107
|
+
return _frosts_ed25519.keys.dkg.part2(_frosts_ed25519.Ed25519Sha512, secretPackage, round1Packages);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Execute DKG round 3 (part3/finalize) - Compute final key package.
|
|
111
|
+
*
|
|
112
|
+
* @param round2SecretPackage - The secret package from part2
|
|
113
|
+
* @param round1Packages - Map of identifier hex to round1 packages
|
|
114
|
+
* @param round2Packages - Map of identifier hex to round2 packages received
|
|
115
|
+
* @returns Promise of tuple [KeyPackage, PublicKeyPackage]
|
|
116
|
+
*/
|
|
117
|
+
async function dkgPart3(round2SecretPackage, round1Packages, round2Packages) {
|
|
118
|
+
return _frosts_ed25519.keys.dkg.part3(_frosts_ed25519.Ed25519Sha512, round2SecretPackage, round1Packages, round2Packages);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Execute signing round 1 - Generate nonces and commitments.
|
|
122
|
+
*
|
|
123
|
+
* @param keyPackage - The participant's key package from DKG
|
|
124
|
+
* @param rng - Random number generator
|
|
125
|
+
* @returns Tuple of [SigningNonces, SigningCommitments]
|
|
126
|
+
*/
|
|
127
|
+
function signingRound1(keyPackage, rng = createRng()) {
|
|
128
|
+
return (0, _frosts_ed25519.commitRound1)(keyPackage.signingShare, rng);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Create a signing package from commitments and message.
|
|
132
|
+
*
|
|
133
|
+
* @param commitments - Map of identifier to signing commitments
|
|
134
|
+
* @param message - The message to sign
|
|
135
|
+
* @returns SigningPackage for round 2
|
|
136
|
+
*/
|
|
137
|
+
function createSigningPackage(commitments, message) {
|
|
138
|
+
return new _frosts_core.SigningPackageImpl(_frosts_ed25519.Ed25519Sha512, commitments, message);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Execute signing round 2 - Generate signature share.
|
|
142
|
+
*
|
|
143
|
+
* @param signingPackage - The signing package with all commitments
|
|
144
|
+
* @param nonces - This participant's nonces from round 1
|
|
145
|
+
* @param keyPackage - This participant's key package
|
|
146
|
+
* @returns Signature share
|
|
147
|
+
*/
|
|
148
|
+
function signingRound2(signingPackage, nonces, keyPackage) {
|
|
149
|
+
return (0, _frosts_ed25519.signRound2)(signingPackage, nonces, keyPackage);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Aggregate signature shares into a final signature.
|
|
153
|
+
*
|
|
154
|
+
* @param signingPackage - The signing package used for round 2
|
|
155
|
+
* @param signatureShares - Map of identifier to signature shares
|
|
156
|
+
* @param publicKeyPackage - The group's public key package
|
|
157
|
+
* @returns The aggregated signature
|
|
158
|
+
*/
|
|
159
|
+
function aggregateSignatures(signingPackage, signatureShares, publicKeyPackage) {
|
|
160
|
+
return (0, _frosts_ed25519.aggregate)(signingPackage, signatureShares, publicKeyPackage);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Serialize a DKG round 1 package to JSON-compatible format.
|
|
164
|
+
*/
|
|
165
|
+
function serializeDkgRound1Package(pkg) {
|
|
166
|
+
const json = _frosts_ed25519.serde.round1PackageToJson(pkg);
|
|
167
|
+
return {
|
|
168
|
+
commitment: { coefficients: json.commitment },
|
|
169
|
+
proofOfKnowledge: json.proof_of_knowledge
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Deserialize a DKG round 1 package from JSON format.
|
|
174
|
+
*/
|
|
175
|
+
function deserializeDkgRound1Package(data) {
|
|
176
|
+
const json = {
|
|
177
|
+
header: _frosts_ed25519.serde.DEFAULT_HEADER,
|
|
178
|
+
commitment: data.commitment.coefficients,
|
|
179
|
+
proof_of_knowledge: data.proofOfKnowledge
|
|
180
|
+
};
|
|
181
|
+
return _frosts_ed25519.serde.round1PackageFromJson(json);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Serialize a DKG round 2 package to JSON-compatible format.
|
|
185
|
+
*/
|
|
186
|
+
function serializeDkgRound2Package(pkg) {
|
|
187
|
+
return { signingShare: _frosts_ed25519.serde.round2PackageToJson(pkg).signing_share };
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Deserialize a DKG round 2 package from JSON format.
|
|
191
|
+
*/
|
|
192
|
+
function deserializeDkgRound2Package(data) {
|
|
193
|
+
const json = {
|
|
194
|
+
header: _frosts_ed25519.serde.DEFAULT_HEADER,
|
|
195
|
+
signing_share: data.signingShare
|
|
196
|
+
};
|
|
197
|
+
return _frosts_ed25519.serde.round2PackageFromJson(json);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Serialize a key package to JSON-compatible format.
|
|
201
|
+
*/
|
|
202
|
+
function serializeKeyPackage(keyPackage) {
|
|
203
|
+
const json = _frosts_ed25519.serde.keyPackageToJson(keyPackage);
|
|
204
|
+
return {
|
|
205
|
+
identifier: json.identifier,
|
|
206
|
+
signingShare: json.signing_share,
|
|
207
|
+
verifyingShare: json.verifying_share,
|
|
208
|
+
verifyingKey: json.verifying_key,
|
|
209
|
+
minSigners: json.min_signers
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Deserialize a key package from JSON format.
|
|
214
|
+
*/
|
|
215
|
+
function deserializeKeyPackage(data) {
|
|
216
|
+
const json = {
|
|
217
|
+
header: _frosts_ed25519.serde.DEFAULT_HEADER,
|
|
218
|
+
identifier: data.identifier,
|
|
219
|
+
signing_share: data.signingShare,
|
|
220
|
+
verifying_share: data.verifyingShare,
|
|
221
|
+
verifying_key: data.verifyingKey,
|
|
222
|
+
min_signers: data.minSigners
|
|
223
|
+
};
|
|
224
|
+
return _frosts_ed25519.serde.keyPackageFromJson(json);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Serialize a public key package to JSON-compatible format.
|
|
228
|
+
*/
|
|
229
|
+
function serializePublicKeyPackage(pkg) {
|
|
230
|
+
const json = _frosts_ed25519.serde.publicKeyPackageToJson(pkg);
|
|
231
|
+
return {
|
|
232
|
+
verifyingKey: json.verifying_key,
|
|
233
|
+
verifyingShares: json.verifying_shares,
|
|
234
|
+
...json.min_signers !== void 0 ? { minSigners: json.min_signers } : {}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Deserialize a public key package from JSON format.
|
|
239
|
+
*/
|
|
240
|
+
function deserializePublicKeyPackage(data) {
|
|
241
|
+
const json = {
|
|
242
|
+
header: _frosts_ed25519.serde.DEFAULT_HEADER,
|
|
243
|
+
verifying_key: data.verifyingKey,
|
|
244
|
+
verifying_shares: data.verifyingShares,
|
|
245
|
+
min_signers: data.minSigners
|
|
246
|
+
};
|
|
247
|
+
return _frosts_ed25519.serde.publicKeyPackageFromJson(json);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Serialize signing nonces to JSON-compatible format.
|
|
251
|
+
*/
|
|
252
|
+
function serializeSigningNonces(nonces) {
|
|
253
|
+
return {
|
|
254
|
+
hiding: bytesToHex(nonces.hiding.serialize()),
|
|
255
|
+
binding: bytesToHex(nonces.binding.serialize()),
|
|
256
|
+
commitments: {
|
|
257
|
+
hiding: bytesToHex(nonces.commitments.hiding.serialize()),
|
|
258
|
+
binding: bytesToHex(nonces.commitments.binding.serialize())
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Serialize signing commitments to JSON-compatible format.
|
|
264
|
+
*/
|
|
265
|
+
function serializeSigningCommitments(commitments) {
|
|
266
|
+
const json = _frosts_ed25519.serde.signingCommitmentsToJson(commitments);
|
|
267
|
+
return {
|
|
268
|
+
hiding: json.hiding,
|
|
269
|
+
binding: json.binding
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Deserialize signing commitments from JSON format.
|
|
274
|
+
*/
|
|
275
|
+
function deserializeSigningCommitments(data) {
|
|
276
|
+
const json = {
|
|
277
|
+
header: _frosts_ed25519.serde.DEFAULT_HEADER,
|
|
278
|
+
hiding: data.hiding,
|
|
279
|
+
binding: data.binding
|
|
280
|
+
};
|
|
281
|
+
return _frosts_ed25519.serde.signingCommitmentsFromJson(json);
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Serialize a signature share to hex string.
|
|
285
|
+
*/
|
|
286
|
+
function serializeSignatureShare(share) {
|
|
287
|
+
return _frosts_ed25519.serde.signatureShareToJson(share).share;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Deserialize a signature share from hex string.
|
|
291
|
+
*/
|
|
292
|
+
function deserializeSignatureShare(hex) {
|
|
293
|
+
const json = {
|
|
294
|
+
header: _frosts_ed25519.serde.DEFAULT_HEADER,
|
|
295
|
+
share: hex
|
|
296
|
+
};
|
|
297
|
+
return _frosts_ed25519.serde.signatureShareFromJson(json);
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Serialize a signature to bytes.
|
|
301
|
+
*/
|
|
302
|
+
function serializeSignature(sig) {
|
|
303
|
+
return sig.serialize(_frosts_ed25519.Ed25519Sha512);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Serialize a signature to hex string.
|
|
307
|
+
*/
|
|
308
|
+
function serializeSignatureHex(sig) {
|
|
309
|
+
return bytesToHex(sig.serialize(_frosts_ed25519.Ed25519Sha512));
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Convert bytes to hex string.
|
|
313
|
+
*/
|
|
314
|
+
function bytesToHex(bytes) {
|
|
315
|
+
return _frosts_ed25519.serde.bytesToHex(bytes);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Convert hex string to bytes.
|
|
319
|
+
*/
|
|
320
|
+
function hexToBytes(hex) {
|
|
321
|
+
return _frosts_ed25519.serde.hexToBytes(hex);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
//#endregion
|
|
325
|
+
Object.defineProperty(exports, 'SecureRng', {
|
|
326
|
+
enumerable: true,
|
|
327
|
+
get: function () {
|
|
328
|
+
return SecureRng;
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
Object.defineProperty(exports, 'aggregateSignatures', {
|
|
332
|
+
enumerable: true,
|
|
333
|
+
get: function () {
|
|
334
|
+
return aggregateSignatures;
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
Object.defineProperty(exports, 'bytesToHex', {
|
|
338
|
+
enumerable: true,
|
|
339
|
+
get: function () {
|
|
340
|
+
return bytesToHex;
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
Object.defineProperty(exports, 'createRng', {
|
|
344
|
+
enumerable: true,
|
|
345
|
+
get: function () {
|
|
346
|
+
return createRng;
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
Object.defineProperty(exports, 'createSigningPackage', {
|
|
350
|
+
enumerable: true,
|
|
351
|
+
get: function () {
|
|
352
|
+
return createSigningPackage;
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
Object.defineProperty(exports, 'deserializeDkgRound1Package', {
|
|
356
|
+
enumerable: true,
|
|
357
|
+
get: function () {
|
|
358
|
+
return deserializeDkgRound1Package;
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
Object.defineProperty(exports, 'deserializeDkgRound2Package', {
|
|
362
|
+
enumerable: true,
|
|
363
|
+
get: function () {
|
|
364
|
+
return deserializeDkgRound2Package;
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
Object.defineProperty(exports, 'deserializeIdentifier', {
|
|
368
|
+
enumerable: true,
|
|
369
|
+
get: function () {
|
|
370
|
+
return deserializeIdentifier;
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
Object.defineProperty(exports, 'deserializeKeyPackage', {
|
|
374
|
+
enumerable: true,
|
|
375
|
+
get: function () {
|
|
376
|
+
return deserializeKeyPackage;
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
Object.defineProperty(exports, 'deserializePublicKeyPackage', {
|
|
380
|
+
enumerable: true,
|
|
381
|
+
get: function () {
|
|
382
|
+
return deserializePublicKeyPackage;
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
Object.defineProperty(exports, 'deserializeSignatureShare', {
|
|
386
|
+
enumerable: true,
|
|
387
|
+
get: function () {
|
|
388
|
+
return deserializeSignatureShare;
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
Object.defineProperty(exports, 'deserializeSigningCommitments', {
|
|
392
|
+
enumerable: true,
|
|
393
|
+
get: function () {
|
|
394
|
+
return deserializeSigningCommitments;
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
Object.defineProperty(exports, 'dkgPart1', {
|
|
398
|
+
enumerable: true,
|
|
399
|
+
get: function () {
|
|
400
|
+
return dkgPart1;
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
Object.defineProperty(exports, 'dkgPart2', {
|
|
404
|
+
enumerable: true,
|
|
405
|
+
get: function () {
|
|
406
|
+
return dkgPart2;
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
Object.defineProperty(exports, 'dkgPart3', {
|
|
410
|
+
enumerable: true,
|
|
411
|
+
get: function () {
|
|
412
|
+
return dkgPart3;
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
Object.defineProperty(exports, 'frost_exports', {
|
|
416
|
+
enumerable: true,
|
|
417
|
+
get: function () {
|
|
418
|
+
return frost_exports;
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
Object.defineProperty(exports, 'hexToBytes', {
|
|
422
|
+
enumerable: true,
|
|
423
|
+
get: function () {
|
|
424
|
+
return hexToBytes;
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
Object.defineProperty(exports, 'identifierFromU16', {
|
|
428
|
+
enumerable: true,
|
|
429
|
+
get: function () {
|
|
430
|
+
return identifierFromU16;
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
Object.defineProperty(exports, 'identifierToHex', {
|
|
434
|
+
enumerable: true,
|
|
435
|
+
get: function () {
|
|
436
|
+
return identifierToHex;
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
Object.defineProperty(exports, 'serializeDkgRound1Package', {
|
|
440
|
+
enumerable: true,
|
|
441
|
+
get: function () {
|
|
442
|
+
return serializeDkgRound1Package;
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
Object.defineProperty(exports, 'serializeDkgRound2Package', {
|
|
446
|
+
enumerable: true,
|
|
447
|
+
get: function () {
|
|
448
|
+
return serializeDkgRound2Package;
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
Object.defineProperty(exports, 'serializeIdentifier', {
|
|
452
|
+
enumerable: true,
|
|
453
|
+
get: function () {
|
|
454
|
+
return serializeIdentifier;
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
Object.defineProperty(exports, 'serializeKeyPackage', {
|
|
458
|
+
enumerable: true,
|
|
459
|
+
get: function () {
|
|
460
|
+
return serializeKeyPackage;
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
Object.defineProperty(exports, 'serializePublicKeyPackage', {
|
|
464
|
+
enumerable: true,
|
|
465
|
+
get: function () {
|
|
466
|
+
return serializePublicKeyPackage;
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
Object.defineProperty(exports, 'serializeSignature', {
|
|
470
|
+
enumerable: true,
|
|
471
|
+
get: function () {
|
|
472
|
+
return serializeSignature;
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
Object.defineProperty(exports, 'serializeSignatureHex', {
|
|
476
|
+
enumerable: true,
|
|
477
|
+
get: function () {
|
|
478
|
+
return serializeSignatureHex;
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
Object.defineProperty(exports, 'serializeSignatureShare', {
|
|
482
|
+
enumerable: true,
|
|
483
|
+
get: function () {
|
|
484
|
+
return serializeSignatureShare;
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
Object.defineProperty(exports, 'serializeSigningCommitments', {
|
|
488
|
+
enumerable: true,
|
|
489
|
+
get: function () {
|
|
490
|
+
return serializeSigningCommitments;
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
Object.defineProperty(exports, 'serializeSigningNonces', {
|
|
494
|
+
enumerable: true,
|
|
495
|
+
get: function () {
|
|
496
|
+
return serializeSigningNonces;
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
Object.defineProperty(exports, 'signingRound1', {
|
|
500
|
+
enumerable: true,
|
|
501
|
+
get: function () {
|
|
502
|
+
return signingRound1;
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
Object.defineProperty(exports, 'signingRound2', {
|
|
506
|
+
enumerable: true,
|
|
507
|
+
get: function () {
|
|
508
|
+
return signingRound2;
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
//# sourceMappingURL=frost-CMH1K0Cw.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frost-CMH1K0Cw.cjs","names":["Identifier","Ed25519Sha512","keys","SigningPackageImpl","serde"],"sources":["../src/frost/index.ts"],"sourcesContent":["/**\n * FROST cryptographic operations module.\n *\n * This module wraps the @frosts/ed25519 library to provide FROST\n * threshold signature operations for DKG and signing.\n *\n * @module\n */\n\nimport {\n Ed25519Sha512,\n Identifier,\n keys,\n serde,\n commitRound1,\n signRound2,\n aggregate,\n type Ed25519SigningNonces,\n type Ed25519SigningCommitments,\n type Ed25519SignatureShare,\n type Ed25519Signature,\n type KeyPackage,\n type PublicKeyPackage,\n type SigningShare,\n} from \"@frosts/ed25519\";\n\nimport { type SigningPackage, SigningPackageImpl, type RandomSource } from \"@frosts/core\";\n\n// Re-export types for convenience\nexport type {\n Ed25519SigningNonces,\n Ed25519SigningCommitments,\n Ed25519SignatureShare,\n Ed25519Signature,\n KeyPackage,\n PublicKeyPackage,\n RandomSource,\n};\n\nexport { Ed25519Sha512, Identifier, keys };\n\n// Type aliases for frost-hubert\nexport type FrostIdentifier = Identifier<typeof Ed25519Sha512>;\nexport type FrostKeyPackage = KeyPackage<typeof Ed25519Sha512>;\nexport type FrostPublicKeyPackage = PublicKeyPackage<typeof Ed25519Sha512>;\nexport type FrostSigningPackage = SigningPackage<typeof Ed25519Sha512>;\nexport type FrostSigningShare = SigningShare<typeof Ed25519Sha512>;\n\n// DKG round types - use the namespaced types from keys.dkg\nexport type DkgRound1Package = keys.dkg.round1.Package;\nexport type DkgRound1SecretPackage = keys.dkg.round1.SecretPackage;\nexport type DkgRound2Package = keys.dkg.round2.Package;\nexport type DkgRound2SecretPackage = keys.dkg.round2.SecretPackage;\n\n/**\n * Cryptographically secure random number generator using Web Crypto API.\n */\nexport class SecureRng implements RandomSource {\n fill(array: Uint8Array): void {\n globalThis.crypto.getRandomValues(array);\n }\n}\n\n/**\n * Create a new secure random number generator.\n */\nexport function createRng(): RandomSource {\n return new SecureRng();\n}\n\n/**\n * Create an identifier from a number (1-indexed participant ID).\n */\nexport function identifierFromU16(id: number): FrostIdentifier {\n return Identifier.fromU16(Ed25519Sha512, id);\n}\n\n/**\n * Serialize an identifier to bytes.\n */\nexport function serializeIdentifier(id: FrostIdentifier): Uint8Array {\n return id.serialize();\n}\n\n/**\n * Deserialize an identifier from bytes.\n */\nexport function deserializeIdentifier(bytes: Uint8Array): FrostIdentifier {\n return Identifier.deserialize(Ed25519Sha512, bytes);\n}\n\n/**\n * Convert an identifier to a hex string for use as a map key.\n */\nexport function identifierToHex(id: FrostIdentifier): string {\n return bytesToHex(id.serialize());\n}\n\n// =============================================================================\n// DKG Operations\n// =============================================================================\n\n/**\n * Execute DKG round 1 (part1) - Generate commitment and proof of knowledge.\n *\n * @param identifier - This participant's identifier\n * @param maxSigners - Total number of participants\n * @param minSigners - Threshold (minimum signers required)\n * @param rng - Random number generator\n * @returns Tuple of [SecretPackage, Package] where Package is broadcast to all\n */\nexport function dkgPart1(\n identifier: FrostIdentifier,\n maxSigners: number,\n minSigners: number,\n rng: RandomSource = createRng(),\n): [DkgRound1SecretPackage, DkgRound1Package] {\n return keys.dkg.part1(Ed25519Sha512, identifier, maxSigners, minSigners, rng);\n}\n\n/**\n * Execute DKG round 2 (part2) - Process round 1 packages and generate shares.\n *\n * @param secretPackage - The secret package from part1\n * @param round1Packages - Map of identifier hex to round1 packages from other participants\n * @returns Tuple of [Round2SecretPackage, Map of round2 packages to send]\n */\nexport function dkgPart2(\n secretPackage: DkgRound1SecretPackage,\n round1Packages: Map<string, DkgRound1Package>,\n): [DkgRound2SecretPackage, Map<string, DkgRound2Package>] {\n return keys.dkg.part2(Ed25519Sha512, secretPackage, round1Packages);\n}\n\n/**\n * Execute DKG round 3 (part3/finalize) - Compute final key package.\n *\n * @param round2SecretPackage - The secret package from part2\n * @param round1Packages - Map of identifier hex to round1 packages\n * @param round2Packages - Map of identifier hex to round2 packages received\n * @returns Promise of tuple [KeyPackage, PublicKeyPackage]\n */\nexport async function dkgPart3(\n round2SecretPackage: DkgRound2SecretPackage,\n round1Packages: Map<string, DkgRound1Package>,\n round2Packages: Map<string, DkgRound2Package>,\n): Promise<[FrostKeyPackage, FrostPublicKeyPackage]> {\n return keys.dkg.part3(Ed25519Sha512, round2SecretPackage, round1Packages, round2Packages);\n}\n\n// =============================================================================\n// Signing Operations\n// =============================================================================\n\n/**\n * Execute signing round 1 - Generate nonces and commitments.\n *\n * @param keyPackage - The participant's key package from DKG\n * @param rng - Random number generator\n * @returns Tuple of [SigningNonces, SigningCommitments]\n */\nexport function signingRound1(\n keyPackage: FrostKeyPackage,\n rng: RandomSource = createRng(),\n): [Ed25519SigningNonces, Ed25519SigningCommitments] {\n return commitRound1(keyPackage.signingShare, rng);\n}\n\n/**\n * Create a signing package from commitments and message.\n *\n * @param commitments - Map of identifier to signing commitments\n * @param message - The message to sign\n * @returns SigningPackage for round 2\n */\nexport function createSigningPackage(\n commitments: Map<FrostIdentifier, Ed25519SigningCommitments>,\n message: Uint8Array,\n): FrostSigningPackage {\n return new SigningPackageImpl(Ed25519Sha512, commitments, message);\n}\n\n/**\n * Execute signing round 2 - Generate signature share.\n *\n * @param signingPackage - The signing package with all commitments\n * @param nonces - This participant's nonces from round 1\n * @param keyPackage - This participant's key package\n * @returns Signature share\n */\nexport function signingRound2(\n signingPackage: FrostSigningPackage,\n nonces: Ed25519SigningNonces,\n keyPackage: FrostKeyPackage,\n): Ed25519SignatureShare {\n return signRound2(signingPackage, nonces, keyPackage);\n}\n\n/**\n * Aggregate signature shares into a final signature.\n *\n * @param signingPackage - The signing package used for round 2\n * @param signatureShares - Map of identifier to signature shares\n * @param publicKeyPackage - The group's public key package\n * @returns The aggregated signature\n */\nexport function aggregateSignatures(\n signingPackage: FrostSigningPackage,\n signatureShares: Map<FrostIdentifier, Ed25519SignatureShare>,\n publicKeyPackage: FrostPublicKeyPackage,\n): Ed25519Signature {\n return aggregate(signingPackage, signatureShares, publicKeyPackage);\n}\n\n// =============================================================================\n// Serialization Helpers - Using @frosts/ed25519 serde module\n// =============================================================================\n\n/**\n * Serialize a DKG round 1 package to JSON-compatible format.\n */\nexport function serializeDkgRound1Package(pkg: DkgRound1Package): SerializedDkgRound1Package {\n const json = serde.round1PackageToJson(pkg);\n return {\n commitment: {\n coefficients: json.commitment,\n },\n proofOfKnowledge: json.proof_of_knowledge,\n };\n}\n\n/**\n * Deserialize a DKG round 1 package from JSON format.\n */\nexport function deserializeDkgRound1Package(data: SerializedDkgRound1Package): DkgRound1Package {\n const json = {\n header: serde.DEFAULT_HEADER,\n commitment: data.commitment.coefficients,\n proof_of_knowledge: data.proofOfKnowledge,\n };\n return serde.round1PackageFromJson(json);\n}\n\n/**\n * Serialize a DKG round 2 package to JSON-compatible format.\n */\nexport function serializeDkgRound2Package(pkg: DkgRound2Package): SerializedDkgRound2Package {\n const json = serde.round2PackageToJson(pkg);\n return {\n signingShare: json.signing_share,\n };\n}\n\n/**\n * Deserialize a DKG round 2 package from JSON format.\n */\nexport function deserializeDkgRound2Package(data: SerializedDkgRound2Package): DkgRound2Package {\n const json = {\n header: serde.DEFAULT_HEADER,\n signing_share: data.signingShare,\n };\n return serde.round2PackageFromJson(json);\n}\n\n/**\n * Serialize a key package to JSON-compatible format.\n */\nexport function serializeKeyPackage(keyPackage: FrostKeyPackage): SerializedKeyPackage {\n const json = serde.keyPackageToJson(keyPackage);\n return {\n identifier: json.identifier,\n signingShare: json.signing_share,\n verifyingShare: json.verifying_share,\n verifyingKey: json.verifying_key,\n minSigners: json.min_signers,\n };\n}\n\n/**\n * Deserialize a key package from JSON format.\n */\nexport function deserializeKeyPackage(data: SerializedKeyPackage): FrostKeyPackage {\n const json = {\n header: serde.DEFAULT_HEADER,\n identifier: data.identifier,\n signing_share: data.signingShare,\n verifying_share: data.verifyingShare,\n verifying_key: data.verifyingKey,\n min_signers: data.minSigners,\n };\n return serde.keyPackageFromJson(json);\n}\n\n/**\n * Serialize a public key package to JSON-compatible format.\n */\nexport function serializePublicKeyPackage(pkg: FrostPublicKeyPackage): SerializedPublicKeyPackage {\n const json = serde.publicKeyPackageToJson(pkg);\n return {\n verifyingKey: json.verifying_key,\n verifyingShares: json.verifying_shares,\n // minSigners may be undefined in older packages\n ...(json.min_signers !== undefined ? { minSigners: json.min_signers } : {}),\n };\n}\n\n/**\n * Deserialize a public key package from JSON format.\n */\nexport function deserializePublicKeyPackage(\n data: SerializedPublicKeyPackage,\n): FrostPublicKeyPackage {\n const json = {\n header: serde.DEFAULT_HEADER,\n verifying_key: data.verifyingKey,\n verifying_shares: data.verifyingShares,\n min_signers: data.minSigners,\n };\n return serde.publicKeyPackageFromJson(json);\n}\n\n/**\n * Serialize signing nonces to JSON-compatible format.\n */\nexport function serializeSigningNonces(nonces: Ed25519SigningNonces): SerializedSigningNonces {\n // Access the internal properties of the nonces\n return {\n hiding: bytesToHex(nonces.hiding.serialize()),\n binding: bytesToHex(nonces.binding.serialize()),\n commitments: {\n hiding: bytesToHex(nonces.commitments.hiding.serialize()),\n binding: bytesToHex(nonces.commitments.binding.serialize()),\n },\n };\n}\n\n/**\n * Serialize signing commitments to JSON-compatible format.\n */\nexport function serializeSigningCommitments(\n commitments: Ed25519SigningCommitments,\n): SerializedSigningCommitments {\n const json = serde.signingCommitmentsToJson(commitments);\n return {\n hiding: json.hiding,\n binding: json.binding,\n };\n}\n\n/**\n * Deserialize signing commitments from JSON format.\n */\nexport function deserializeSigningCommitments(\n data: SerializedSigningCommitments,\n): Ed25519SigningCommitments {\n const json = {\n header: serde.DEFAULT_HEADER,\n hiding: data.hiding,\n binding: data.binding,\n };\n return serde.signingCommitmentsFromJson(json);\n}\n\n/**\n * Serialize a signature share to hex string.\n */\nexport function serializeSignatureShare(share: Ed25519SignatureShare): string {\n const json = serde.signatureShareToJson(share);\n return json.share;\n}\n\n/**\n * Deserialize a signature share from hex string.\n */\nexport function deserializeSignatureShare(hex: string): Ed25519SignatureShare {\n const json = {\n header: serde.DEFAULT_HEADER,\n share: hex,\n };\n return serde.signatureShareFromJson(json);\n}\n\n/**\n * Serialize a signature to bytes.\n */\nexport function serializeSignature(sig: Ed25519Signature): Uint8Array {\n return sig.serialize(Ed25519Sha512);\n}\n\n/**\n * Serialize a signature to hex string.\n */\nexport function serializeSignatureHex(sig: Ed25519Signature): string {\n return bytesToHex(sig.serialize(Ed25519Sha512));\n}\n\n// =============================================================================\n// Serialized Type Definitions\n// =============================================================================\n\nexport interface SerializedDkgRound1Package {\n commitment: {\n coefficients: string[]; // hex-encoded coefficient commitments\n };\n proofOfKnowledge: string; // hex-encoded proof of knowledge\n}\n\nexport interface SerializedDkgRound2Package {\n signingShare: string; // hex-encoded signing share\n}\n\nexport interface SerializedKeyPackage {\n identifier: string;\n signingShare: string;\n verifyingShare: string;\n verifyingKey: string;\n minSigners: number;\n}\n\nexport interface SerializedPublicKeyPackage {\n verifyingKey: string;\n verifyingShares: Record<string, string>; // identifier hex -> verifying share hex\n minSigners?: number;\n}\n\nexport interface SerializedSigningNonces {\n hiding: string;\n binding: string;\n commitments: {\n hiding: string;\n binding: string;\n };\n}\n\nexport interface SerializedSigningCommitments {\n hiding: string;\n binding: string;\n}\n\n// =============================================================================\n// Utility Functions - Re-export from serde\n// =============================================================================\n\n/**\n * Convert bytes to hex string.\n */\nexport function bytesToHex(bytes: Uint8Array): string {\n return serde.bytesToHex(bytes);\n}\n\n/**\n * Convert hex string to bytes.\n */\nexport function hexToBytes(hex: string): Uint8Array {\n return serde.hexToBytes(hex);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAa,YAAb,MAA+C;CAC7C,KAAK,OAAyB;AAC5B,aAAW,OAAO,gBAAgB,MAAM;;;;;;AAO5C,SAAgB,YAA0B;AACxC,QAAO,IAAI,WAAW;;;;;AAMxB,SAAgB,kBAAkB,IAA6B;AAC7D,QAAOA,2BAAW,QAAQC,+BAAe,GAAG;;;;;AAM9C,SAAgB,oBAAoB,IAAiC;AACnE,QAAO,GAAG,WAAW;;;;;AAMvB,SAAgB,sBAAsB,OAAoC;AACxE,QAAOD,2BAAW,YAAYC,+BAAe,MAAM;;;;;AAMrD,SAAgB,gBAAgB,IAA6B;AAC3D,QAAO,WAAW,GAAG,WAAW,CAAC;;;;;;;;;;;AAgBnC,SAAgB,SACd,YACA,YACA,YACA,MAAoB,WAAW,EACa;AAC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