I am working on the elliptic curve and pairing stuff in Ethereum smart contract. How can I compute pairing such e(p1,p2)?
I know that we have a pre-compile pairing check in Ethereum client which is live at 0x08, and performs the pairing check.
From the documentation:
success := call(sub(gas, 2000), 8, 0, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)
This means we can just check equality of two pairings in a smart contract. However, I require the computation of exactly one pairing such as e(p1,p2)=? in Solidity.