code: def verifyG1(x, tTilde, y, pi, errorOnFail=True):
      
      # Unpack the proof
      p,c,u = pi
  
      # Verify types
      assertType(x, G1Element)
      assertType(tTilde, G2Element)
      assertType(y, GtElement)
      assertType(p, G1Element)
  
      # TODO: beta can be pre-computed while waiting for a server response.
      Q = generatorG1()
      beta = pair(x,tTilde)
  
      # Recompute c'
      t1 = Q*u + p*c 
      t2 = beta**u * y**c
  
      t1.normalize()
  
      cPrime = hashZ(Q,p,beta,y,t1,t2)
  
      # Check computed @c' against server's value @c
      if cPrime == c:
          return True
  
      if errorOnFail:
          raise Exception("zero-knowledge proof failed verification.")
      else:
          return False
docs: Verifies a zero-knowledge proof where p \in G1.
      @errorOnFail: Raise an exception if the proof does not hold.