@atlasauth/pca-mpc 0.0.0-stage → 0.2.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 +65 -2
- package/dist/beaver.d.ts +49 -0
- package/dist/beaver.js +72 -0
- package/dist/beaver.js.map +1 -0
- package/dist/compose.d.ts +21 -0
- package/dist/compose.js +33 -0
- package/dist/compose.js.map +1 -0
- package/dist/csprng.d.ts +46 -0
- package/dist/csprng.js +86 -0
- package/dist/csprng.js.map +1 -0
- package/dist/ec.d.ts +130 -0
- package/dist/ec.js +475 -0
- package/dist/ec.js.map +1 -0
- package/dist/endemic-ot.d.ts +209 -0
- package/dist/endemic-ot.js +405 -0
- package/dist/endemic-ot.js.map +1 -0
- package/dist/field.d.ts +34 -0
- package/dist/field.js +65 -0
- package/dist/field.js.map +1 -0
- package/dist/gf128.d.ts +23 -0
- package/dist/gf128.js +59 -0
- package/dist/gf128.js.map +1 -0
- package/dist/hybrid-ot.d.ts +153 -0
- package/dist/hybrid-ot.js +241 -0
- package/dist/hybrid-ot.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +46 -0
- package/dist/index.js.map +1 -0
- package/dist/kem-ot.d.ts +292 -0
- package/dist/kem-ot.js +559 -0
- package/dist/kem-ot.js.map +1 -0
- package/dist/mascot.d.ts +189 -0
- package/dist/mascot.js +322 -0
- package/dist/mascot.js.map +1 -0
- package/dist/ot.d.ts +212 -0
- package/dist/ot.js +536 -0
- package/dist/ot.js.map +1 -0
- package/dist/party.d.ts +38 -0
- package/dist/party.js +40 -0
- package/dist/party.js.map +1 -0
- package/dist/runner.d.ts +56 -0
- package/dist/runner.js +97 -0
- package/dist/runner.js.map +1 -0
- package/dist/sharing.d.ts +40 -0
- package/dist/sharing.js +97 -0
- package/dist/sharing.js.map +1 -0
- package/dist/spdz-runner.d.ts +50 -0
- package/dist/spdz-runner.js +107 -0
- package/dist/spdz-runner.js.map +1 -0
- package/dist/spdz.d.ts +136 -0
- package/dist/spdz.js +243 -0
- package/dist/spdz.js.map +1 -0
- package/dist/thermometer.d.ts +22 -0
- package/dist/thermometer.js +41 -0
- package/dist/thermometer.js.map +1 -0
- package/package.json +58 -3
package/dist/spdz.js
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* SPDZ-style authenticated secret sharing over F_p — the MALICIOUS-security layer.
|
|
4
|
+
*
|
|
5
|
+
* The semi-honest layer (`sharing.ts` + `beaver.ts`) is correct only if every party follows the
|
|
6
|
+
* protocol: a party that lies in an opening silently corrupts the result and is never caught. SPDZ
|
|
7
|
+
* closes that gap with *information-theoretic MACs*. A global MAC key `α ∈ F_p` is itself additively
|
|
8
|
+
* shared (`α = Σ_i α_i`, no single party knows `α`). Every authenticated value `⟦x⟧` carries, besides
|
|
9
|
+
* its value shares `x_i` (summing to `x`), a vector of MAC shares `γ_i` summing to `α·x`:
|
|
10
|
+
*
|
|
11
|
+
* ⟦x⟧ = ( x_i , γ_i ) with Σ x_i = x and Σ γ_i = α·x.
|
|
12
|
+
*
|
|
13
|
+
* Linear ops keep the invariant `Σ γ_i = α·(Σ x_i)` with NO interaction (add/sub of sharings,
|
|
14
|
+
* public-scalar multiply, and — the SPDZ trick — adding a PUBLIC constant updates each party's MAC
|
|
15
|
+
* share by `α_i·c`, which the party can do locally because it holds `α_i`). Beaver multiplication
|
|
16
|
+
* produces an authenticated product. Before any value is accepted as output the parties run the
|
|
17
|
+
* SPDZ **MAC-check** (random linear combination + commit-then-open of the residual `Σγ − α·a`); any
|
|
18
|
+
* party that fed an inconsistent value or MAC share into an opening makes the residual non-zero and
|
|
19
|
+
* the protocol ABORTS. The result is therefore *correct, or an abort* — never a silent wrong answer.
|
|
20
|
+
*
|
|
21
|
+
* Security upgrade: semi-honest → **malicious-with-abort, dishonest-majority** (secure against up to
|
|
22
|
+
* N−1 actively-corrupted parties; privacy and MAC-forgery-resistance both hold at the N−1 threshold).
|
|
23
|
+
* The MAC is information-theoretic: forging a MAC on a wrong value succeeds with probability ≤ 2/p
|
|
24
|
+
* (here ≈ 2^−60), independent of the adversary's computing power.
|
|
25
|
+
*
|
|
26
|
+
* OFFLINE-PHASE BOUNDARY (honest, see docs §7): the authenticated triples / input sharings below are
|
|
27
|
+
* produced by a TRUSTED DEALER that honestly knows `α`. That keeps the *online* phase — openings,
|
|
28
|
+
* MAC updates, and the MAC-check — the real, maliciously-secure thing, with the dealer as the one
|
|
29
|
+
* explicit trust assumption. A no-dealer offline phase (MASCOT/Overdrive: OT- or HE-based authenticated
|
|
30
|
+
* triple generation, itself maliciously secure, with a distributed `α` nobody ever reconstructs) is
|
|
31
|
+
* NOT implemented here; its interface is exactly `setupMac` + `genAuthTriple` + `authShare`, so it
|
|
32
|
+
* drops in under the same online protocol. The commitment below is SHA-256 (a real binding commitment,
|
|
33
|
+
* via `node:crypto`), modelling the commit-then-open round that defeats a rushing adversary.
|
|
34
|
+
*/
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.SpdzEngine = exports.MacCheckAbort = void 0;
|
|
37
|
+
exports.setupMac = setupMac;
|
|
38
|
+
exports.authShare = authShare;
|
|
39
|
+
exports.authConstant = authConstant;
|
|
40
|
+
exports.addAuth = addAuth;
|
|
41
|
+
exports.subAuth = subAuth;
|
|
42
|
+
exports.negAuth = negAuth;
|
|
43
|
+
exports.scaleAuth = scaleAuth;
|
|
44
|
+
exports.addPublicAuth = addPublicAuth;
|
|
45
|
+
exports.notBitAuth = notBitAuth;
|
|
46
|
+
exports.genAuthTriple = genAuthTriple;
|
|
47
|
+
exports.beaverMulAuth = beaverMulAuth;
|
|
48
|
+
exports.authValue = authValue;
|
|
49
|
+
const node_crypto_1 = require("node:crypto");
|
|
50
|
+
const field_1 = require("./field");
|
|
51
|
+
const sharing_1 = require("./sharing");
|
|
52
|
+
/** Raised when the SPDZ MAC-check detects an inconsistent opening/MAC: the protocol ABORTS, no output. */
|
|
53
|
+
class MacCheckAbort extends Error {
|
|
54
|
+
constructor(message) {
|
|
55
|
+
super(message);
|
|
56
|
+
this.name = 'MacCheckAbort';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.MacCheckAbort = MacCheckAbort;
|
|
60
|
+
/** Dealer preprocessing: sample the global MAC key α and additively share it across n parties. */
|
|
61
|
+
function setupMac(n, rng) {
|
|
62
|
+
if (!Number.isInteger(n) || n < 1)
|
|
63
|
+
throw new Error('setupMac: n must be a positive integer');
|
|
64
|
+
const alpha = rng.next();
|
|
65
|
+
return { n, alpha, alphaShares: (0, sharing_1.share)(alpha, n, rng) };
|
|
66
|
+
}
|
|
67
|
+
/** Authenticated sharing of `secret` (dealer-side): value shares sum to x, MAC shares sum to α·x. */
|
|
68
|
+
function authShare(secret, ctx, rng) {
|
|
69
|
+
const v = (0, field_1.mod)(secret);
|
|
70
|
+
return { value: (0, sharing_1.share)(v, ctx.n, rng), mac: (0, sharing_1.share)((0, field_1.fmul)(ctx.alpha, v), ctx.n, rng) };
|
|
71
|
+
}
|
|
72
|
+
/** Authenticated sharing of a PUBLIC constant c: value = shareConstant(c), MAC = share of α·c (via α_i·c). */
|
|
73
|
+
function authConstant(c, ctx) {
|
|
74
|
+
const v = (0, field_1.mod)(c);
|
|
75
|
+
const value = new Array(ctx.n).fill(0n);
|
|
76
|
+
value[0] = v;
|
|
77
|
+
// γ_i = α_i · c so that Σ γ_i = α·c, with no randomness and no interaction.
|
|
78
|
+
const mac = ctx.alphaShares.map((ai) => (0, field_1.fmul)(ai, v));
|
|
79
|
+
return { value, mac };
|
|
80
|
+
}
|
|
81
|
+
/** ⟦x⟧ + ⟦y⟧ (local; MAC shares add, preserving Σγ = α·(x+y)). */
|
|
82
|
+
function addAuth(x, y) {
|
|
83
|
+
requireSame(x, y);
|
|
84
|
+
return {
|
|
85
|
+
value: x.value.map((xi, i) => (0, field_1.fadd)(xi, y.value[i])),
|
|
86
|
+
mac: x.mac.map((mi, i) => (0, field_1.fadd)(mi, y.mac[i])),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** ⟦x⟧ − ⟦y⟧ (local). */
|
|
90
|
+
function subAuth(x, y) {
|
|
91
|
+
requireSame(x, y);
|
|
92
|
+
return {
|
|
93
|
+
value: x.value.map((xi, i) => (0, field_1.fsub)(xi, y.value[i])),
|
|
94
|
+
mac: x.mac.map((mi, i) => (0, field_1.fsub)(mi, y.mac[i])),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/** −⟦x⟧ (local). */
|
|
98
|
+
function negAuth(x) {
|
|
99
|
+
return { value: x.value.map(field_1.fneg), mac: x.mac.map(field_1.fneg) };
|
|
100
|
+
}
|
|
101
|
+
/** ⟦x⟧ · c for a PUBLIC scalar c (local): both value and MAC shares scale by c. */
|
|
102
|
+
function scaleAuth(x, c) {
|
|
103
|
+
const k = (0, field_1.mod)(c);
|
|
104
|
+
return { value: x.value.map((xi) => (0, field_1.fmul)(xi, k)), mac: x.mac.map((mi) => (0, field_1.fmul)(mi, k)) };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* ⟦x⟧ + c for a PUBLIC constant c (local). The SPDZ public-constant rule: add c to ONE party's value
|
|
108
|
+
* share, and add α_i·c to EVERY party's MAC share (each party holds α_i), so Σγ becomes α·x + α·c =
|
|
109
|
+
* α·(x+c). This is what lets affine gates stay authenticated without any interaction.
|
|
110
|
+
*/
|
|
111
|
+
function addPublicAuth(x, c, ctx) {
|
|
112
|
+
const k = (0, field_1.mod)(c);
|
|
113
|
+
const value = x.value.slice();
|
|
114
|
+
value[0] = (0, field_1.fadd)(value[0], k);
|
|
115
|
+
const mac = x.mac.map((mi, i) => (0, field_1.fadd)(mi, (0, field_1.fmul)(ctx.alphaShares[i], k)));
|
|
116
|
+
return { value, mac };
|
|
117
|
+
}
|
|
118
|
+
/** Logical NOT of an authenticated bit b: ⟦1 − b⟧ (local). */
|
|
119
|
+
function notBitAuth(b, ctx) {
|
|
120
|
+
return addPublicAuth(negAuth(b), 1n, ctx);
|
|
121
|
+
}
|
|
122
|
+
/** Dealer preprocessing: one authenticated triple (a, b, c=a·b), every component MAC'd. */
|
|
123
|
+
function genAuthTriple(ctx, rng) {
|
|
124
|
+
const a = rng.next();
|
|
125
|
+
const b = rng.next();
|
|
126
|
+
return {
|
|
127
|
+
a: authShare(a, ctx, rng),
|
|
128
|
+
b: authShare(b, ctx, rng),
|
|
129
|
+
c: authShare((0, field_1.fmul)(a, b), ctx, rng),
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The SPDZ online engine: performs partial openings (broadcast value shares, sum to the public value,
|
|
134
|
+
* RETAIN the MAC shares for a single batched MAC-check at the end) and the MAC-check itself. A list of
|
|
135
|
+
* `Deviation`s models one or more actively-malicious parties corrupting their broadcasts; the engine
|
|
136
|
+
* records exactly what would reach the honest parties, so the MAC-check sees the tampered transcript.
|
|
137
|
+
*/
|
|
138
|
+
class SpdzEngine {
|
|
139
|
+
ctx;
|
|
140
|
+
deviations;
|
|
141
|
+
/** Each partial-open: the (possibly tampered) public value and the (possibly tampered) MAC shares. */
|
|
142
|
+
opened = [];
|
|
143
|
+
counter = 0;
|
|
144
|
+
constructor(ctx, deviations = []) {
|
|
145
|
+
this.ctx = ctx;
|
|
146
|
+
this.deviations = deviations;
|
|
147
|
+
}
|
|
148
|
+
/** How many opens have happened (lets tests target the last/output open by index). */
|
|
149
|
+
get openCount() {
|
|
150
|
+
return this.counter;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Partial-open ⟦x⟧: parties broadcast value shares, the public value is their sum, and the MAC
|
|
154
|
+
* shares are retained for the batched MAC-check. Does NOT check the MAC here (that is the whole
|
|
155
|
+
* point of SPDZ: open cheaply during the circuit, verify everything once at the end).
|
|
156
|
+
*/
|
|
157
|
+
open(x, label = '') {
|
|
158
|
+
const idx = this.counter++;
|
|
159
|
+
const valueShares = x.value.slice();
|
|
160
|
+
const macShares = x.mac.slice();
|
|
161
|
+
for (const d of this.deviations) {
|
|
162
|
+
if (d.openIndex !== idx)
|
|
163
|
+
continue;
|
|
164
|
+
if (d.party < 0 || d.party >= this.ctx.n)
|
|
165
|
+
throw new Error('Deviation.party out of range');
|
|
166
|
+
if (d.valueDelta !== undefined)
|
|
167
|
+
valueShares[d.party] = (0, field_1.fadd)(valueShares[d.party], d.valueDelta);
|
|
168
|
+
if (d.macDelta !== undefined)
|
|
169
|
+
macShares[d.party] = (0, field_1.fadd)(macShares[d.party], d.macDelta);
|
|
170
|
+
}
|
|
171
|
+
const value = valueShares.reduce((a, b) => (0, field_1.fadd)(a, b), 0n);
|
|
172
|
+
this.opened.push({ value, macShares, label });
|
|
173
|
+
return value;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* SPDZ MAC-check over every partial-open so far. Draws public random coefficients r_j (a secure
|
|
177
|
+
* coin-flip in the real protocol; a seeded RNG here, documented), forms the public combination
|
|
178
|
+
* a = Σ r_j·a_j and each party's residual share σ_i = (Σ r_j·γ_i(a_j)) − α_i·a, then runs
|
|
179
|
+
* commit-then-open on the σ_i and checks Σ σ_i = 0. Honest runs give exactly 0; ANY inconsistent
|
|
180
|
+
* opened value or forged MAC makes it non-zero with probability ≥ 1 − 2/p, and we ABORT.
|
|
181
|
+
*
|
|
182
|
+
* The commit-then-open (SHA-256 binding commitment) models the round that stops a *rushing*
|
|
183
|
+
* adversary from choosing its σ_i after seeing the others — it must commit before any are revealed.
|
|
184
|
+
*/
|
|
185
|
+
macCheck(rng) {
|
|
186
|
+
if (this.opened.length === 0)
|
|
187
|
+
return;
|
|
188
|
+
const r = this.opened.map(() => rng.next());
|
|
189
|
+
let a = 0n;
|
|
190
|
+
for (let j = 0; j < this.opened.length; j++)
|
|
191
|
+
a = (0, field_1.fadd)(a, (0, field_1.fmul)(r[j], this.opened[j].value));
|
|
192
|
+
const sigma = [];
|
|
193
|
+
for (let i = 0; i < this.ctx.n; i++) {
|
|
194
|
+
let gamma = 0n;
|
|
195
|
+
for (let j = 0; j < this.opened.length; j++) {
|
|
196
|
+
gamma = (0, field_1.fadd)(gamma, (0, field_1.fmul)(r[j], this.opened[j].macShares[i]));
|
|
197
|
+
}
|
|
198
|
+
sigma.push((0, field_1.fsub)(gamma, (0, field_1.fmul)(this.ctx.alphaShares[i], a)));
|
|
199
|
+
}
|
|
200
|
+
// Commit-then-open: every party commits to σ_i (binding) before any σ is revealed.
|
|
201
|
+
const nonces = sigma.map(() => rng.next());
|
|
202
|
+
const commitments = sigma.map((s, i) => commit(s, nonces[i]));
|
|
203
|
+
for (let i = 0; i < sigma.length; i++) {
|
|
204
|
+
// Opening phase: a σ_i revealed inconsistent with its commitment is itself an abort.
|
|
205
|
+
if (commit(sigma[i], nonces[i]) !== commitments[i]) {
|
|
206
|
+
throw new MacCheckAbort(`MAC-check: commitment from party ${i} did not open consistently`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
const residual = sigma.reduce((x, y) => (0, field_1.fadd)(x, y), 0n);
|
|
210
|
+
if (residual !== 0n) {
|
|
211
|
+
throw new MacCheckAbort(`MAC-check FAILED: residual ${residual} != 0 — an actively-malicious party was detected; aborting with no output`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
exports.SpdzEngine = SpdzEngine;
|
|
216
|
+
/**
|
|
217
|
+
* Authenticated Beaver multiplication: returns ⟦x·y⟧, consuming `triple`, via the engine's partial
|
|
218
|
+
* opens of d = x−a and e = y−b. The product sharing is assembled with the authenticated linear ops,
|
|
219
|
+
* so its MAC shares sum to α·(x·y). The two opens are recorded for the batched MAC-check: a party that
|
|
220
|
+
* opens d or e inconsistently is caught there.
|
|
221
|
+
*/
|
|
222
|
+
function beaverMulAuth(x, y, triple, ctx, engine, label = '') {
|
|
223
|
+
const d = engine.open(subAuth(x, triple.a), `${label}:d`);
|
|
224
|
+
const e = engine.open(subAuth(y, triple.b), `${label}:e`);
|
|
225
|
+
// ⟦z⟧ = ⟦c⟧ + d·⟦b⟧ + e·⟦a⟧ + d·e (the last term is a public constant, MAC'd via α_i).
|
|
226
|
+
let z = addAuth(triple.c, addAuth(scaleAuth(triple.b, d), scaleAuth(triple.a, e)));
|
|
227
|
+
z = addPublicAuth(z, (0, field_1.fmul)(d, e), ctx);
|
|
228
|
+
return z;
|
|
229
|
+
}
|
|
230
|
+
/** Full-reconstruct an authenticated value's cleartext (sum of value shares). Used after MAC-check passes. */
|
|
231
|
+
function authValue(x) {
|
|
232
|
+
return x.value.reduce((a, b) => (0, field_1.fadd)(a, b), 0n);
|
|
233
|
+
}
|
|
234
|
+
/** SHA-256 binding commitment to a field element under a nonce. Real (node:crypto); models commit-then-open. */
|
|
235
|
+
function commit(value, nonce) {
|
|
236
|
+
return (0, node_crypto_1.createHash)('sha256').update(`${value.toString(16)}:${nonce.toString(16)}`).digest('hex');
|
|
237
|
+
}
|
|
238
|
+
function requireSame(x, y) {
|
|
239
|
+
if (x.value.length !== y.value.length || x.mac.length !== y.mac.length) {
|
|
240
|
+
throw new Error('authenticated shared values must have the same party count');
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
//# sourceMappingURL=spdz.js.map
|
package/dist/spdz.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spdz.js","sourceRoot":"","sources":["../src/spdz.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;AAuCH,4BAIC;AAGD,8BAGC;AAGD,oCAOC;AAGD,0BAMC;AAGD,0BAMC;AAGD,0BAEC;AAGD,8BAGC;AAOD,sCAMC;AAGD,gCAEC;AAGD,sCAQC;AA4GD,sCAcC;AAGD,8BAEC;AAlPD,6CAAyC;AACzC,mCAAgE;AAChE,uCAAkC;AA0BlC,0GAA0G;AAC1G,MAAa,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC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C,EAAE,EAAE,CAAC,IAAA,YAAI,EAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,gHAAgH;AAChH,SAAS,MAAM,CAAC,KAAa,EAAE,KAAa;IAC1C,OAAO,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAClG,CAAC;AAED,SAAS,WAAW,CAAC,CAAS,EAAE,CAAS;IACvC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;QACvE,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thermometer (unary) encoding of a bounded integer, which is what lets us compute MAX securely
|
|
3
|
+
* using only the AND/OR primitive (hence only Beaver multiplication) — no comparison circuit.
|
|
4
|
+
*
|
|
5
|
+
* A value v in {0..M} is encoded as the bit vector ge[k] = [v >= k] for k = 1..M. Because v>=k
|
|
6
|
+
* implies v>=k-1, the vector is monotone: a block of 1s followed by 0s. Then:
|
|
7
|
+
* - MAX of several values = position-wise OR of their thermometers (OR preserves monotonicity,
|
|
8
|
+
* and (max v)>=k iff some v_i >= k). Decoding = counting the leading 1s.
|
|
9
|
+
* - OR of bits over N parties = 1 - Π_i (1 - b_i), i.e. built from multiplication.
|
|
10
|
+
*
|
|
11
|
+
* So "max over a small bounded domain" reduces to the same shared-multiplication primitive as "AND
|
|
12
|
+
* of allow bits", and we never reveal any party's individual thermometer — only the composed one,
|
|
13
|
+
* which encodes exactly the agreed MAX (the intended output).
|
|
14
|
+
*/
|
|
15
|
+
/** Encode v in {0..M} as ge[k] = (v >= k) for k=1..M. Clamps v into range (fail-safe). */
|
|
16
|
+
export declare function thermometerEncode(v: number, M: number): number[];
|
|
17
|
+
/**
|
|
18
|
+
* Decode a thermometer back to an integer = the number of 1s. For a well-formed (monotone)
|
|
19
|
+
* thermometer this is the encoded value; for the composed OR it is the MAX. Robust to non-monotone
|
|
20
|
+
* input (counts set bits), which only matters defensively.
|
|
21
|
+
*/
|
|
22
|
+
export declare function thermometerDecode(bits: ReadonlyArray<number | bigint>): number;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Thermometer (unary) encoding of a bounded integer, which is what lets us compute MAX securely
|
|
4
|
+
* using only the AND/OR primitive (hence only Beaver multiplication) — no comparison circuit.
|
|
5
|
+
*
|
|
6
|
+
* A value v in {0..M} is encoded as the bit vector ge[k] = [v >= k] for k = 1..M. Because v>=k
|
|
7
|
+
* implies v>=k-1, the vector is monotone: a block of 1s followed by 0s. Then:
|
|
8
|
+
* - MAX of several values = position-wise OR of their thermometers (OR preserves monotonicity,
|
|
9
|
+
* and (max v)>=k iff some v_i >= k). Decoding = counting the leading 1s.
|
|
10
|
+
* - OR of bits over N parties = 1 - Π_i (1 - b_i), i.e. built from multiplication.
|
|
11
|
+
*
|
|
12
|
+
* So "max over a small bounded domain" reduces to the same shared-multiplication primitive as "AND
|
|
13
|
+
* of allow bits", and we never reveal any party's individual thermometer — only the composed one,
|
|
14
|
+
* which encodes exactly the agreed MAX (the intended output).
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.thermometerEncode = thermometerEncode;
|
|
18
|
+
exports.thermometerDecode = thermometerDecode;
|
|
19
|
+
/** Encode v in {0..M} as ge[k] = (v >= k) for k=1..M. Clamps v into range (fail-safe). */
|
|
20
|
+
function thermometerEncode(v, M) {
|
|
21
|
+
if (!Number.isInteger(M) || M < 0)
|
|
22
|
+
throw new Error('thermometerEncode: M must be a non-negative integer');
|
|
23
|
+
const clamped = Math.max(0, Math.min(M, Math.trunc(v)));
|
|
24
|
+
const bits = [];
|
|
25
|
+
for (let k = 1; k <= M; k++)
|
|
26
|
+
bits.push(clamped >= k ? 1 : 0);
|
|
27
|
+
return bits;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Decode a thermometer back to an integer = the number of 1s. For a well-formed (monotone)
|
|
31
|
+
* thermometer this is the encoded value; for the composed OR it is the MAX. Robust to non-monotone
|
|
32
|
+
* input (counts set bits), which only matters defensively.
|
|
33
|
+
*/
|
|
34
|
+
function thermometerDecode(bits) {
|
|
35
|
+
let count = 0;
|
|
36
|
+
for (const b of bits)
|
|
37
|
+
if (b === 1 || b === 1n)
|
|
38
|
+
count++;
|
|
39
|
+
return count;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=thermometer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thermometer.js","sourceRoot":"","sources":["../src/thermometer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAGH,8CAMC;AAOD,8CAIC;AAlBD,0FAA0F;AAC1F,SAAgB,iBAAiB,CAAC,CAAS,EAAE,CAAS;IACpD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAC1G,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,IAAoC;IACpE,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,IAAI;QAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE;YAAE,KAAK,EAAE,CAAC;IACvD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/pca-mpc",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Multi-stakeholder policy VM composed under secure multi-party computation (semi-honest additive secret sharing over a prime field) with a post-quantum base-OT. Experimental reference prototype.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"secure multi-party computation",
|
|
7
|
+
"mpc",
|
|
8
|
+
"oblivious transfer",
|
|
9
|
+
"policy vm",
|
|
10
|
+
"prototype",
|
|
11
|
+
"agent authorization",
|
|
12
|
+
"proof-carrying authority",
|
|
13
|
+
"pca",
|
|
14
|
+
"ai agents"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"homepage": "https://github.com/Atlas-Authorization/pca#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/Atlas-Authorization/pca/issues"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/Atlas-Authorization/pca.git",
|
|
24
|
+
"directory": "packages/pca-mpc"
|
|
25
|
+
},
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@noble/post-quantum": "^0.4.1",
|
|
37
|
+
"@atlasauth/pca": "0.2.0",
|
|
38
|
+
"@atlasauth/pca-mpc-wasm": "0.2.0",
|
|
39
|
+
"@atlasauth/pca-mpc-lwe-ot-wasm": "0.2.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"typescript": "^5.6.3",
|
|
43
|
+
"vitest": "^2.1.4"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"README.md",
|
|
48
|
+
"LICENSE"
|
|
49
|
+
],
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=20"
|
|
52
|
+
},
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsc -p tsconfig.build.json",
|
|
58
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
59
|
+
"test": "vitest run"
|
|
60
|
+
}
|
|
6
61
|
}
|