aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2025-07-28 12:35:51 +0200
committerNicholas Rodrigues Lordello <[email protected]>2025-07-28 12:35:51 +0200
commit96c1a864a7c3cdd5006cef5ae8e30cdca61d303a (patch)
treecc138e06b9d4cacf04e520c293aecc829a5dfffd /docs
parent2bf12c1d8c9c879d9d3907457e36e8b1b3217315 (diff)
Pairing Tests and Refactor
We refactored the extension field types to use an array for coefficients instead of a tuple. Tests were modified to only have string literals for numerical literals (istead of previously encoding a whole `Fp12` in a single string for example). As a result, we get better formatting and more line breaks instead of super dense and long lines. Unfortunately, this makes a very big PR instead. The pairing development will continue in the next one to not overgrow this too much.
Diffstat (limited to 'docs')
-rw-r--r--docs/journal/README.md3
-rw-r--r--docs/journal/pages/extension-fields.md (renamed from docs/journal/pages/field-extension.md)6
-rw-r--r--docs/journal/pages/pairings.md11
3 files changed, 16 insertions, 4 deletions
diff --git a/docs/journal/README.md b/docs/journal/README.md
index a16fa3f..20f10aa 100644
--- a/docs/journal/README.md
+++ b/docs/journal/README.md
@@ -5,6 +5,7 @@ This directory contains the development journal for PLONKers!. It is a collectio
## Table of Contents
1. [Finite Fields](./pages/finite-fields.md)
-2. [Field Extension](./pages/field-extension.md)
+2. [Extension Fields](./pages/extension-fields.md)
3. [Elliptic Curves](./pages/elliptic-curves.md)
4. [Torsion](./pages/torsion.md)
+4. [Pairings](./pages/pairings.md)
diff --git a/docs/journal/pages/field-extension.md b/docs/journal/pages/extension-fields.md
index 6995570..eec81d8 100644
--- a/docs/journal/pages/field-extension.md
+++ b/docs/journal/pages/extension-fields.md
@@ -1,10 +1,10 @@
> [Index](../README.md)
-# Polynomial Extension Rings
+# Extension Fields (Polynomial Extension Rings)
-The other kind of field that is important for elliptic curve pairings are polynomial extension fields. These are just polynomial quotient rings over the curve's field modulo some irreducible monic polynomial (chosen as a parameter of the extension field). This concept is a _little_ complicated, and the Wikipedia article linked in the resources section does a decent job at explainng it (at least better than I can, as I lack a lot of the jargon required).
+The other kind of field that is important for elliptic curve pairings are extension fields, and more specifically polynomial extension rings. These are just polynomial quotient rings over the curve's field modulo some irreducible monic polynomial (chosen as a parameter of the extension field). This concept is a _little_ complicated, and the Wikipedia article linked in the resources section does a decent job at explainng it (at least better than I can, as I lack a lot of the jargon required).
-To try and explain it better, lets take the polynomial extension field of degree 2 used in BLS12-381 pairings. This is defined as the polynomial quotient ring `Fp[x] / (1 + x^2)`, or `Fp2` for brevity, where `Fp[x]` are polynomials over the field `Fp`. With a slightly more concrete example, imagine the polynomials `a + bx` and `c + dx` belonging to `Fp2` where `a`, `b`, `c`, `d` are elements of `Fp` and `x` is some indeterminate also belonging to `Fp`. In code we can represent the elements of `Fp2` as a tuple of two `Fp` elements `Fp.t * Fp.t` where `(a, b)` represents `a + bx`. For this field, addition and multiplication are just definied to be the addition and multiplication modulo `1 + x^2` respectively of the polynomials.
+To try and summarize it, lets take the polynomial extension field of degree 2 used in BLS12-381 pairings. This is defined as the polynomial quotient ring `Fp[x] / (1 + x^2)`, or `Fp2` for brevity, where `Fp[x]` are polynomials over the field `Fp`. With a slightly more concrete example, imagine the polynomials `a + bx` and `c + dx` belonging to `Fp2` where `a`, `b`, `c`, `d` are elements of `Fp` and `x` is some indeterminate also belonging to `Fp`. In code we can represent the elements of `Fp2` as a tuple of two `Fp` elements `Fp.t * Fp.t` where `(a, b)` represents `a + bx`. For this field, addition and multiplication are just definied to be the addition and multiplication modulo `1 + x^2` respectively of the polynomials.
- Addition: `(a + bx) + (c + dx) = (a + c) + (b + d)x`. Since we don't create any `x^2` terms, this is already non-divisible by `1 + x^2`. Addition in these polynomial extension fields are, therefore, very straight forward: `(a, b) + (c, d) = (a + b, c + d)`.
- Multiplication: `(a + bx) * (c + dx) = ac + adx + bcx + bdx^2`. This must be taken modulo `1 + x^2`, so `ac + adx + bcx + bdx^2 =~ ac + adx + bcx + bdx^2 - bd(1 + x^2) =~ (ac - bd) + (ad + bc)x`. Multiplication over `Fp2` is therefore `(a, b) * (c, d) = (ac - bd, ad + bc)`. Look familiar? It is the same as complex number multiplication - which isn't a coincidence as the complex numbers are an extension field of degree 2 over the real numbers.
diff --git a/docs/journal/pages/pairings.md b/docs/journal/pages/pairings.md
new file mode 100644
index 0000000..7260b08
--- /dev/null
+++ b/docs/journal/pages/pairings.md
@@ -0,0 +1,11 @@
+> [Index](../README.md)
+
+# Pairings
+
+TODO.
+
+# Resources
+
+- [Resource](https://example.com)
+
+> [Index](../README.md)