halo2_ecc::bigint::carry_mod

Function crt

Source
pub fn crt<F: BigPrimeField>(
    range: &impl RangeInstructions<F>,
    ctx: &mut Context<F>,
    a: CRTInteger<F>,
    k_bits: usize,
    modulus: &BigInt,
    mod_vec: &[F],
    mod_native: F,
    limb_bits: usize,
    limb_bases: &[F],
    limb_base_big: &BigInt,
) -> ProperCrtUint<F>
Expand description

ยงAssumptions

  • abs(a) <= 2n * k - 1 + F::NUM_BITS - 2 (A weaker assumption is also enough, but this is good enough for forseeable use cases)
  • native_modulus::<F> requires exactly k = a.limbs.len() limbs to represent