def proveGt(x,tTilde,kw,y):
    """
    Generate a zero-knowledge proof that DL(g^kw) == DL(e(x,t)^kw) where
    g,e(..) \in Gt.
    @return pi = (p,c,u)
    """
    # Verify types
    assertType(x, G1Element)
    assertType(tTilde, G2Element)

    # Compute the proof.
    beta = pair(x,tTilde)
    g = generatorGt()
    p = g**kw
    v = randomZ(orderGt())
    t1 = g**v
    t2 = beta**v

    c = hashZ(g,p,beta,y,t1,t2)
    u = (v- (c*kw)) % orderGt()
    return (p,c,u)