On 2026-07-06 in 05de18e “Merge pull request #458 from worldfnd/sl/goldilocks-field-abstraction”:
with stronger constraints on log_bases will allow us to remove the
remaining allocation
}
/// Compute a mixed-base decomposition of a field element into its digits, using
/// the given log bases. Decomposition is little-endian.
/// Panics if the value provided can not be represented in the given bases.
// TODO: with stronger constraints on log_bases will allow us to remove the
// remaining allocation
pub fn decompose_into_digits<F: PrimeField>(value: F, log_bases: &[usize]) -> Vec<F> {
let num_digits = log_bases.len();
let mut digits = Vec::with_capacity(num_digits);
let mut value_bits = field_to_le_bits(value);
let ref_value_bits = &mut value_bits;
From provekit/backend/bn254/src/witness/digits.rs:32
On 2026-07-06 in
05de18e“Merge pull request #458 from worldfnd/sl/goldilocks-field-abstraction”:with stronger constraints on log_bases will allow us to remove the
remaining allocation
From
provekit/backend/bn254/src/witness/digits.rs:32