You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/src/background/curves.md
+38-2Lines changed: 38 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -271,7 +271,22 @@ over $E_q/\mathbb{F}_q,$ forming a 2-cycle with the first:
271
271
272
272

273
273
274
-
### TODO: Pallas-Vesta curves
274
+
### Pallas-Vesta curves
275
+
276
+
The Pallas and Vesta curves form a 2-cycle of elliptic curves designed specifically for Halo 2. They are defined over finite fields with highly 2-adic structure, meaning they have large multiplicative subgroups of order $2^S$ where $S = 32$.
277
+
278
+
**Pallas curve ($E_p/\mathbb{F}_p$):**
279
+
- Base field: $\mathbb{F}_p$ where $p = 2^{254} + t_p$ and $t_p = 45560315531419706090280762371685220353$
280
+
- Scalar field: $\mathbb{F}_q$ where $q = 2^{254} + t_q$ and $t_q = 45560315531506369815346746415080538113$
281
+
- Curve equation: $y^2 = x^3 + 5$
282
+
283
+
**Vesta curve ($E_q/\mathbb{F}_q$):**
284
+
- Base field: $\mathbb{F}_q$ (same as Pallas scalar field)
285
+
- Scalar field: $\mathbb{F}_p$ (same as Pallas base field)
286
+
- Curve equation: $y^2 = x^3 + 5$
287
+
288
+
This 2-cycle structure enables efficient recursive proof composition, where proofs generated on one curve can be efficiently verified on the other curve. The highly 2-adic structure ($p-1 = T \cdot 2^{32}$ with $T$ odd) provides efficient FFT operations and enables a wide variety of circuit sizes.
289
+
275
290
Reference: https://github.com/zcash/pasta
276
291
277
292
## Hashing to curves
@@ -290,7 +305,28 @@ framework used in the Internet Draft makes use of several functions:
The Simplified SWU (Shallue-van de Woestijne-Ulas) method is an efficient hash-to-curve algorithm that maps field elements to curve points. It is particularly well-suited for curves of the form $y^2 = x^3 + b$ where $b \neq 0$.
311
+
312
+
For a field element $u \in \mathbb{F}_p$, the Simplified SWU algorithm works as follows:
313
+
314
+
1.**Precomputation**: Compute $Z = -b/A$ where $A$ is a non-square in $\mathbb{F}_p$
315
+
2.**Mapping**: For input $u$, compute:
316
+
- $t_1 = -Z \cdot (1 + u^2)$
317
+
- $t_2 = -Z \cdot (1 - u^2)$
318
+
- $x_1 = t_1^3 + b$
319
+
- $x_2 = t_2^3 + b$
320
+
- $x_3 = Z \cdot (t_1^2 \cdot t_2^2)$
321
+
322
+
3.**Selection**: Choose the first $x_i$ that is a square in $\mathbb{F}_p$
323
+
4.**Square root**: Compute $y = \sqrt{x_i^3 + b}$
324
+
5.**Sign adjustment**: If $u \cdot y$ is negative, negate $y$
325
+
326
+
The result is the curve point $(x_i, y)$.
327
+
328
+
This method is constant-time, deterministic, and provides a uniform distribution over the curve points. It is used in Halo 2 for various cryptographic operations including parameter generation and commitment schemes.
0 commit comments