halo2_base::utils

Function decompose_biguint

Source
pub fn decompose_biguint<F: BigPrimeField>(
    e: &BigUint,
    num_limbs: usize,
    bit_len: usize,
) -> Vec<F>
Expand description

Decomposes an immutable reference to a BigUint into num_limbs limbs of bit_len bits each and returns a Vec of BigPrimeField represented by those limbs.

Assumes 64 <= bit_len < 128.

  • e: immutable reference to BigInt to decompose
  • num_limbs: number of limbs to decompose e into
  • bit_len: number of bits in each limb

Truncates to num_limbs limbs if e is too large.