Skip to main content

textbook_mul

Function textbook_mul 

Source
pub fn textbook_mul(
    builder: &CircuitBuilder,
    a: &BigUint,
    b: &BigUint,
) -> BigUint
Expand description

Multiply two arbitrary-sized BigUints using textbook algorithm.

Produces O(a.len() * b.len()) constraints.

Computes a * b where both inputs are BigUints. The result will have a.limbs.len() + b.limbs.len() limbs to accommodate the full product without overflow.

§Arguments

  • builder - Circuit builder for constraint generation
  • a - First operand BigUint
  • b - Second operand BigUint

§Returns

Product BigUint with a.limbs.len() + b.limbs.len() limbs