def METHOD_NAME(self, n):
    g1, g2 = group.random(G1), group.random(G2)
    h = group.random(G1)
    xi1, xi2 = group.random(), group.random()
    u,v = h ** ~xi1, h ** ~xi2
    gamma = group.random(ZR)
    w = g2 ** gamma
    gpk = { 'g1':g1, 'g2':g2, 'h':h, 'u':u, 'v':v, 'w':w }
    gmsk = { 'xi1':xi1, 'xi2':xi2 }
    x = [group.random(ZR) for i in range(n)]
    A = [gpk['g1'] ** ~(gamma + x[i]) for i in range(n)]
    gsk = {}
    if debug: print("\nSecret keys...")
    for i in range(n):
        if debug: print("User %d: A = %s, x = %s" % (i, A[i], x[i]))
        gsk[i] = (A[i], x[i]) 
    return (gpk, gmsk, gsk)