// ---
// tags: genies, source
// crystal-type: source
// crystal-domain: comp
// ---
//! Class group action: [a] * E for ideal class [a] and supersingular curve E.
//!
//! The action iterates through the 74 small primes in q+1, applying โ-isogenies
//! for each prime factor according to the exponent vector.
use crate;
use crate;
use crateisogeny;
/// The 74 small odd primes dividing q+1.
pub const PRIMES: = ;
/// Number of primes.
pub const NUM_PRIMES: usize = 74;
/// Maximum exponent magnitude for CSIDH-512.
pub const MAX_EXPONENT: i8 = 5;
/// An ideal class element, represented as an exponent vector.
/// Each exponent is in [-MAX_EXPONENT, MAX_EXPONENT].
/// Compute (q+1) / ell as an 8-limb big integer.
/// Since q+1 = 4 * l_1 * ... * l_74, dividing by any l_i gives an exact result.
/// Simple deterministic x-coordinate sampling for point finding.
/// Returns successive x = 0, 1, 2, 3, ... (skipping those that don't yield
/// points of the desired type).
/// Compute the class group action: [ideal] * curve.
///
/// For each prime โ_i with exponent e_i:
/// - If e_i > 0: find a point on E_A of order โ_i, apply e_i โ_i-isogenies
/// - If e_i < 0: find a point on the twist of E_A, apply |e_i| โ_i-isogenies
/// (twist point: x where x^3 + Ax^2 + x is a non-residue)
/// Diffie-Hellman convenience: action(secret, peer_curve).
/// The commutativity of the class group gives:
/// dh(a, dh(b, E_0)) = dh(b, dh(a, E_0))
genies/rs/src/action.rs
ฯ 0.0%