pub fn hash_bn254_with_fn<F>(&self, hasher: F) -> BigUint
    where
        F: Fn(&[u8]) -> Vec<u8>,
    {
        // Hash the public values.
        let mut hash = hasher(self.buffer.data.as_slice());

        // Mask the top 3 bits.
        hash[0] &= 0b00011111;

        // Return the masked hash as a BigUint.
        BigUint::from_bytes_be(hash.as_slice())
    }
Hash the public values using the provided `hasher` function, mask the top 3 bits and
return a BigUint.
crates/primitives/src/io.rs