Function pairing

Source
pub fn pairing(input: &[u8], gas_limit: u64) -> PrecompileResult
Expand description

Pairing call expects 384*k (k being a positive integer) bytes as an inputs that is interpreted as byte concatenation of k slices. Each slice has the following structure:

  • 128 bytes of G1 point encoding
  • 256 bytes of G2 point encoding

Each point is expected to be in the subgroup of order q. Output is 32 bytes where first 31 bytes are equal to 0x00 and the last byte is 0x01 if pairing result is equal to the multiplicative identity in a pairing target field and 0x00 otherwise.

See also: https://eips.ethereum.org/EIPS/eip-2537#abi-for-pairing