Skip to main content

coprime_form

Function coprime_form 

Source
fn coprime_form<P, U: AsRef<[Limb]> + AsMut<[Limb]> + CtSelect + Gcd<P, Output: One>>(
    a: U,
    (b_positive, b_abs): (Choice, U),
    c: U,
    p: &P,
) -> CtOption<(U, (Choice, U))>
Expand description

For a primitive reduced positive definite form of negative discriminant, return the equivalent form whose a coefficient is coprime to the prime p.

The inputs MUST have sufficient capacity to calculate a + b + c, b + 2 a. Additionally, a, b, c, p MUST be of the same size.

This function runs in constant time. It WILL NOT return None if the inputs are satisfied but MAY return None if for invalid inputs, if it fails to find an equivalent form with a coprime a coefficient.