TritonVM / tasm-lib

A collection of functions written in Triton VM assembly (tasm)
Apache License 2.0
11 stars 2 forks source link

Add function to return "first_free_address" of ND-memory #125

Closed Sword-Smith closed 3 weeks ago

Sword-Smith commented 3 weeks ago

I saw this pattern in stark_verify and thought we might as well have the as a helper function in the memory module.

        let first_free_address = nondeterminism
            .ram
            .keys()
            .map(|&b| b.value())
            .filter(|&b| b < (1u64 << 32))
            .max()
            .map(|m| BFieldElement::new(m + 1))
            .unwrap_or(BFieldElement::ZERO);