Skip to content

Commit 5eb54f7

Browse files
committed
fix math rendering
1 parent 47dbddb commit 5eb54f7

1 file changed

Lines changed: 40 additions & 36 deletions

File tree

docs/concepts/threshold-encryption/1-threshold-encryption.md

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ Below we describe the encryption-time validation in detail.
210210
1. Recompute the hash-to-curve point:
211211
`H' = H(U, V) ∈ G1`.
212212
2. Check the pairing equation:
213-
$$
213+
214+
```math
214215
e(W, P) \stackrel{?}{=} e(H', U)
215-
$$
216+
```
216217

217218
**Why it works (bilinear proof).**
218219
Assuming honest formation with the *same* scalar `r`:
@@ -246,41 +247,43 @@ Given a ciphertext `{U, V, W}` and a purported decryption share $D_i$ from node
246247
**Setup.**
247248

248249
During encryption:
249-
$$
250+
```math
250251
U = rP \in G_2,\qquad
251252
W = r\,H(U,V) \in G_1,
252-
$$
253+
```
253254
where $H(U,V)\in G_1$ is a hash-to-curve of `(U,V)`.
255+
254256
For node $i$:
255-
$$
257+
```math
256258
Y_i = s_i P \in G_2,\qquad
257259
D_i = s_i U = s_i (rP) = (r s_i) P \in G_2.
258-
$$
260+
```
261+
259262
Let $e: G_1 \times G_2 \to G_T$ be a bilinear pairing.
260263

261264

262265
**Validation equations.**
263266

264267
1) **Ciphertext integrity (same $r$ across `U` and `W`).**
265-
$$
268+
```math
266269
e(W, P)\;\stackrel{?}{=}\;e(H(U,V), U).
267-
$$
270+
```
268271
If true, then $W = r H(U,V)$ and $U = rP$ share the same randomness $r$. (Smae as we did in 3.1)
269272

270273
2) **Per-share correctness (same $s_i$, same $r$).**
271-
$$
274+
```math
272275
e(W, Y_i)\;\stackrel{?}{=}\;e(H(U,V), D_i).
273-
$$
276+
```
274277

275278
**Why it works.**
276279

277280
- For 1), we have already seen why it works from 3.1.
278281

279282
- For 2), for a valid share with $Y_i=s_iP$ and $D_i=s_iU=s_i(rP)$:
280-
$$
283+
```math
281284
e(W,Y_i)=e(rH, s_iP)=e(H,P)^{r s_i},\qquad
282285
e(H,D_i)=e(H, s_i r P)=e(H,P)^{r s_i},
283-
$$
286+
```
284287
so the second equality holds **iff** $D_i$ was computed from the *same* $r$ (via $U$) and the *correct* secret share $s_i$ (via $Y_i$).
285288

286289

@@ -296,9 +299,9 @@ Verify that the decrypted message is mathematically consistent with the cipherte
296299

297300
During encryption:
298301

299-
$$
302+
```math
300303
U = rP, \quad V = G(rY) \oplus m
301-
$$
304+
```
302305

303306
where
304307
- $r \in \mathbb{F}_r$ is a random scalar,
@@ -312,42 +315,42 @@ After decryption, the payload reveals a candidate scalar $r'$, which should equa
312315

313316
Compute:
314317

315-
$$
318+
```math
316319
Y' = r'Y
317-
$$
320+
```
318321

319322
Derive:
320323

321-
$$
324+
```math
322325
m' = V \oplus G(Y')
323-
$$
326+
```
324327

325328
and verify:
326329

327-
$$
330+
```math
328331
m' = m
329-
$$
332+
```
330333

331334
**Why it works.**
332335

333336
If the combined decryption shares are correct, then $r' = r$.
334337
Hence:
335338

336-
$$
339+
```math
337340
Y' = r'Y = rY
338-
$$
341+
```
339342

340343
and
341344

342-
$$
345+
```math
343346
G(Y') = G(rY)
344-
$$
347+
```
345348

346349
Substituting into the expression for $m'$ gives:
347350

348-
$$
351+
```math
349352
m' = V \oplus G(rY) = (G(rY) \oplus m) \oplus G(rY) = m
350-
$$
353+
```
351354

352355
The equality holds **if and only if** $r'$ matches the original randomness $r$ and the ciphertext `{U, V}` was not tampered with. Any alteration in $r'$, $V$, or $Y$ breaks the equality, making the decryption invalid.
353356

@@ -360,9 +363,10 @@ Verify that the AES key recovered from the decrypted payload is consistent with
360363
**Setup.**
361364

362365
During encryption:
363-
$$
366+
```math
364367
U = rP,\qquad V = G(rY)\oplus m,
365-
$$
368+
```
369+
366370
where $r\in\mathbb{F}_r$ is random, $Y=sP$ is the public key, $G: G_2\to\{0,1\}^{32}$ is a KDF/hash-to-key, and $m$ is the AES-256 key.
367371

368372
After decryption of the outer AES-GCM payload, we obtain a candidate scalar $r'$ (encoded in the plaintext). The ciphertext component $V$ is available from `{U,V,W}`.
@@ -371,25 +375,25 @@ After decryption of the outer AES-GCM payload, we obtain a candidate scalar $r'$
371375
**Validation Equation.**
372376

373377
Compute:
374-
$$
378+
```math
375379
Y' = r'Y,\qquad K' = G(Y'),\qquad m' = V \oplus K'.
376-
$$
380+
```
377381
Accept iff:
378-
$$
382+
```math
379383
m' = m.
380-
$$
384+
```
381385

382386

383387
**Why it works.**
384388

385389
If the decrypted payload is correct and the combine of shares was honest, then $r'=r$. Hence:
386-
$$
390+
```math
387391
Y' = r'Y = rY,\qquad K' = G(Y') = G(rY).
388-
$$
392+
```
389393
Substitute into $m'$:
390-
$$
394+
```math
391395
m' = V \oplus G(rY) = (G(rY)\oplus m)\oplus G(rY) = m.
392-
$$
396+
```
393397
Therefore the equality holds **iff** $r'$ matches the original randomness and $V$ was not altered.
394398

395399

0 commit comments

Comments
 (0)