halo2_ecc/bigint/
negative.rs

1use super::OverflowInteger;
2use halo2_base::{gates::GateInstructions, utils::ScalarField, Context};
3
4pub fn assign<F: ScalarField>(
5    gate: &impl GateInstructions<F>,
6    ctx: &mut Context<F>,
7    a: OverflowInteger<F>,
8) -> OverflowInteger<F> {
9    let out_limbs = a.limbs.into_iter().map(|limb| gate.neg(ctx, limb)).collect();
10    OverflowInteger::new(out_limbs, a.max_limb_bits)
11}