Skip to content

Commit 30476d9

Browse files
authored
Update curves.md
1 parent 2308caf commit 30476d9

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

book/src/background/curves.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,22 @@ over $E_q/\mathbb{F}_q,$ forming a 2-cycle with the first:
271271

272272
![](https://i.imgur.com/bNMyMRu.png)
273273

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+
275290
Reference: https://github.com/zcash/pasta
276291

277292
## Hashing to curves
@@ -290,7 +305,28 @@ framework used in the Internet Draft makes use of several functions:
290305

291306
[cfrg-hash-to-curve]: https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/?include_text=1
292307

293-
### TODO: Simplified SWU
308+
### Simplified SWU
309+
310+
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.
329+
294330
Reference: https://eprint.iacr.org/2019/403.pdf
295331

296332
## References

0 commit comments

Comments
 (0)