forge::revm::interpreter::primitives::alloy_primitives::ruint::algorithms

Function square_redc

pub fn square_redc<const N: usize>(
    a: [u64; N],
    modulus: [u64; N],
    inv: u64,
) -> [u64; N]
Expand description

Computes a^2 * 2^(-BITS) mod modulus

Requires that inv is the inverse of -modulus[0] modulo 2^64. Requires that a is less than modulus.