Expand description
§𝔽_{p²} arithmetic and the supersingular isogeny graph
The quadratic extension 𝔽_{p²} = 𝔽_p[i]/(i²+1) (for p ≡ 3 (mod 4), so −1 is a non-residue and
i² = −1 is irreducible) is where the supersingular curves live — and so where CSIDH, SIKE, and the
2022 Castryck–Decru break happen. This module gives the field arithmetic and builds the supersingular
ℓ=2 isogeny graph: vertices are supersingular j-invariants in 𝔽_{p²}, edges the 2-isogenies. We
build it not through Vélu but through the classical level-2 modular polynomial Φ₂(X,Y) — the three
roots of Φ₂(j, ·) are exactly the j-invariants 2-isogenous to j. So the whole graph is field
arithmetic + cubic root-finding + a breadth-first walk from a known supersingular vertex (j = 1728,
supersingular whenever p ≡ 3 (mod 4)). The result is a 3-regular Ramanujan graph whose size is the
supersingular mass ⌊p/12⌋ + ε.
Structs§
- Curve2
- A Weierstrass curve
y² = x³ + ax + bover𝔽_{p²}. - Isogeny2
- A separable
ell-isogeny over𝔽_{p²}by Vélu’s formulas (theCurve2analogue ofelliptic::Isogeny). - Isogeny
Step2 - A single
ℓ-isogeny step over𝔽_{p²}: domain, the order-ℓkernel, and codomain. - SsVertex
- A vertex of the supersingular isogeny graph: a j-invariant and its 2-isogenous neighbours (as a
multiset — a double root of
Φ₂is a double edge).
Enums§
- Point2
- An affine point over
𝔽_{p²}, or the identity.
Functions§
- aut_
1728 - The order-4 automorphism
ι:(x,y) ↦ (−x, i·y)of thej = 1728curvey² = x³ + x(i² = −1lives in𝔽_{p²}forp ≡ 3 mod 4).ι² = [−1], so⟨ι⟩ ≅ ℤ/4 = Aut(E₀). It permutes the keyspace, andE₀/⟨K⟩ ≅ E₀/⟨ι(K)⟩— the symmetry that makes recovering one kernel recover its whole orbit. - derive_
isogeny_ path2 - Unfold one order-
ℓᵃkernel generator into the chain ofaprime-degreeℓ-isogenies over𝔽_{p²}— theCurve2analogue ofcrate::elliptic::derive_isogeny_path.ℓan odd prime. - fp2_add
- fp2_
const - A rational constant
kas an element of𝔽_{p²}. - fp2_inv
(a+bi)⁻¹ = (a − bi)/(a² + b²).Noneonly for0.- fp2_
is_ zero - fp2_mul
(a+bi)(c+di) = (ac − bd) + (ad + bc)i.- fp2_neg
- fp2_pow
α^kin𝔽_{p²}by square-and-multiply.- fp2_
sqrt √αin𝔽_{p²}(p ≡ 3 mod 4), orNoneifαis not a square. Fromβ² = αwithβ = x + yi:x² − y² = a,2xy = b, whencex² = (a ± √(a²+b²))/2; a finalβ² = αcheck makes it exact.- fp2_sub
- full_
order_ basis2 - A rank-2 basis
(P, Q)ofE[ℓᵃ] = (ℤ/ℓᵃ)²— both of order exactlyℓᵃ, independent. The fullℓᵃ-torsion is𝔽_{p²}-rational on a supersingular curve whenℓᵃ | p+1. - isogeny_
graph_ distances - Backward BFS on the supersingular
ℓ-isogeny graph fromtarget: the minimumℓ-isogeny distance to each reachablej-invariant, out tomax_depth. This is a sound per-digit oracle — a partial curve farther from the target than its remaining step budget cannot lie on the secret path, so its whole subtree is dead. - kernel_
generator2 - The SIDH kernel generator
P + [s]·Qover𝔽_{p²}. - keyspace_
codomain_ classes - Partition the keyspace by codomain
j-invariant: secrets whose isogeny lands on the same curve (up to isomorphism). These classes are exactly theAut(E₀)-orbits — so if one secret in a class is invertible (its codomain is the targetE), every secret in the class maps to a curve≅ E. Returns(j, [secrets])groups. - point_
of_ order2 - A point of prime order
ellover𝔽_{p²}(a candidate isogeny kernel), orNone. - point_
order2 - The order of a point over
𝔽_{p²}(leastk ≥ 1withk·pt = O), searched up tobound. - product_
weil_ pairing - The Weil pairing on a product surface
E₁ × E₂:e((P₁,P₂),(Q₁,Q₂)) = e_N(P₁,Q₁)·e_N(P₂,Q₂). A subgroup on which this vanishes (= 1) is isotropic; a maximal isotropic (Lagrangian) subgroup is the kernel of an(N,N)-isogeny of abelian surfaces — the gluing at the heart of Kani’s theorem and the Castryck–Decru attack. - push_
through2 - Push a point through an entire isogeny chain, rebuilding each step’s Vélu map.
- recover_
secret2 - Images → generator reconstruction (flat oracle). The secret isogeny
φ: E₀ → Eof degreeℓᵃhas kernel⟨P_A + [s]Q_A⟩; the published torsion imagesφ(P_B), φ(Q_B)pinsdown. Enumerate the whole keyspace and return the scalar whose unfolded chain reproduces both images — a genuine images → generator inversion at SIDH scale.O(ℓᵃ); the correctness oracle for the structured recovery below. - recover_
secret_ pruned2 - Oracle-pruned images → generator recovery. Walks the
ℓ-adic keyspace tree but consults the isogeny graph reachability oracle (backward BFS from the public codomaintarget) at every node, pruning any branch that can no longer reach the target. Returns the secret, its generator, and the number of leaf image-tests performed (the pruned search visits only the target’sAut-orbit). Same answer asrecover_secret2— soundness guarantees the true path is never pruned. - recover_
secret_ recursive2 - Structured images → generator recovery. Walks the
ℓ-adic keyspace tree (auto-partitioning by digit) rather than the flat list, returning the recoveredℓ-adic digits, the secrets = Σ dₖ·ℓᵏ, and its generator. Same answer asrecover_secret2— but the recursion is the digit-by-digit structure the Castryck–Decru Kani oracle prunes with a per-digit split-test. - supersingular_
graph - Build the supersingular ℓ=2 isogeny graph over
𝔽_{p²}(requiresp ≡ 3 (mod 4)). Breadth-first from the supersingular vertexj = 1728, following the roots ofΦ₂(j,·). Because the graph is connected, this reaches every supersingular j-invariant; its size is the supersingular mass⌊p/12⌋ + εand every vertex has out-degree 3.Noneifp ≢ 3 (mod 4). - torsion_
basis2 - A torsion basis of
E[n]over𝔽_{p²}(nprime) — the fulln-torsion is𝔽_{p²}-rational on a supersingular curve whenn | p+1.Noneif it is not fully rational. - weil_
pairing2 - The Weil pairing over
𝔽_{p²}— theCurve2analogue ofelliptic::weil_pairing, via Miller.
Type Aliases§
- Fp2
- An element
a + b·iof𝔽_{p²} = 𝔽_p[i]/(i²+1).