title: How to compute pairing in a smart contract
body: <p>I am working on the elliptic curve and pairing stuff in Ethereum smart contract. How can I compute pairing such <code>e(p1,p2)</code>?</p>
  
  <p>I know that we have a pre-compile pairing check in Ethereum client which is live at <code>0x08</code>, and performs the pairing <em>check</em>.</p>
  
  <p>From the documentation:</p>
  
  <pre><code>success := call(sub(gas, 2000), 8, 0, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)
  </code></pre>
  
  <p>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 <code>e(p1,p2)=?</code> in Solidity.</p>