Skip to content

provekit/backend/bn254/src/witness/digits: with stronger constraints on log_bases will allow us to remove the #468

Description

@recmo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    to doTo do comments in codetracker🤖 issue managed by tracker bot

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions