pub fn hook_fp_inverse(_: HookEnv, buf: &[u8]) -> Vec<Vec<u8>> {
        let len: usize = u32::from_be_bytes(buf[0..4].try_into().unwrap()) as usize;

        assert!(buf.len() == 4 + 2 * len, "FpOp: Invalid buffer length");

        let buf = &buf[4..];
        let element = BigUint::from_bytes_be(&buf[..len]);
        let modulus = BigUint::from_bytes_be(&buf[len..2 * len]);

        assert!(!element.is_zero(), "FpOp: Inverse called with zero");

        let inverse = element.modpow(&(&modulus - BigUint::from(2u64)), &modulus);

        vec![pad_to_be(&inverse, len)]
    }
Compute the inverse of a field element.

# Arguments:
* `buf` - The buffer containing the data needed to compute the inverse.
- [ len || Element || Modulus ]
- len is the u32 length of the element and modulus in big endian.
- Element is the field element to compute the inverse of, interpreted as a big endian
integer of `len` bytes.

# Returns:
A single 32 byte vector containing the inverse.

# Panics:
- If the buffer length is not valid.
- If the element is zero.
crates/core/executor/src/hook.rs