Function sp1_recursion_core::memory::compute_addr_diff
source · pub fn compute_addr_diff<F: PrimeField32>(
addr: F,
prev_addr: F,
subtract_one: bool,
) -> (F, F)
Expand description
Computes the difference between the addr
and prev_addr
and returns the 16-bit limb and 12-bit
limbs of the difference.
The parameter subtract_one
is expected to be true
when addr
and prev_addr
are consecutive
addresses in the global memory table (we don’t allow repeated addresses), and false
when this
function is used to perform the 28-bit range check on the addr
field.