Skip to main content

optimal_mul

Function optimal_mul 

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

Multiply two arbitrary-sized BigUints using textbook algorithm.

This method attempts to pick the most efficient multiplication algorithm.

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