@staticmethod
def ringsign(x, pubkey, message, verbose=False):
    '\n        input: x is the privkey from user i, \n              | all public keys: pubkeys,\n              | the message\n         \n        output: (R,m, (H(mR)^xi), c1,t1,...,cn,tn),\n              | R: all the pubkeys concatenated,\n              | cj,tj: random number within Zq\n        '
    R = list_to_string(pubkey)
    g = UniqueRingSignature.g
    q = UniqueRingSignature.q
    h1 = UniqueRingSignature.h1
    h2 = UniqueRingSignature.h2
    mR = (message + str(R))
    C = list()
    T = list()
    A = list()
    B = list()
    ri = (- 1)
    for i in pubkey:
        a = 0
        b = 0
        c = 0
        t = 0
        if (pow(g, x, q) != i):
            (c, t) = (randint(1, q), randint(1, q))
            a = ((pow(g, t) * pow(int(i), c)) % q)
            b = ((pow(h1(mR), t) * pow(pow(h1(mR), x), c)) % q)
        else:
            ri = randint(1, q)
            a = pow(g, ri, q)
            b = pow(h1(mR), ri, q)
            c = (- 1)
            t = (- 1)
        A.append(a)
        B.append(b)
        C.append(c)
        T.append(t)
    cj = 0
    ab = ''.join(('{}{}'.format(*t) for t in zip(A, B)))
    usernr = 0
    for i in range(len(pubkey)):
        if (pubkey[i] != pow(g, x, q)):
            cj = ((cj + C[i]) % q)
        else:
            usernr = i
    ci = (h2(((message + R) + ab)) - (cj % (q - 1)))
    C[usernr] = ci
    ti = ((ri - (C[usernr] * x)) % (q - 1))
    if (ti < 0):
        ti = ((q - 1) + ti)
    T[usernr] = ti
    ct = ','.join(('{},{}'.format(*t) for t in zip(C, T)))
    result = ((((((R + ',') + message) + ',') + str(pow(h1(mR), x, q))) + ',') + ct)
    if (verbose == True):
        print(('RingSign Result: ' + result))
        print('---- RingSign Completed ---- \n')
    return result
input: x is the privkey from user i, 
      | all public keys: pubkeys,
      | the message
 
output: (R,m, (H(mR)^xi), c1,t1,...,cn,tn),
      | R: all the pubkeys concatenated,
      | cj,tj: random number within Zq
@staticmethod
def ringsign(x, pubkey, message, verbose=False):
    '\n        input: x is the privkey from user i, \n              | all public keys: pubkeys,\n              | the message\n         \n        output: (R,m, (H(mR)^xi), c1,t1,...,cn,tn),\n              | R: all the pubkeys concatenated,\n              | cj,tj: random number within Zq\n        '
    R = list_to_string(pubkey)
    g = UniqueRingSignature.g
    q = UniqueRingSignature.q
    h1 = UniqueRingSignature.h1
    h2 = UniqueRingSignature.h2
    mR = (message + str(R))
    C = list()
    T = list()
    A = list()
    B = list()
    ri = (- 1)
    for i in pubkey:
        a = 0
        b = 0
        c = 0
        t = 0
        if (pow(g, x, q) != i):
            (c, t) = (randint(1, q), randint(1, q))
            a = ((pow(g, t) * pow(int(i), c)) % q)
            b = ((pow(h1(mR), t) * pow(pow(h1(mR), x), c)) % q)
        else:
            ri = randint(1, q)
            a = pow(g, ri, q)
            b = pow(h1(mR), ri, q)
            c = (- 1)
            t = (- 1)
        A.append(a)
        B.append(b)
        C.append(c)
        T.append(t)
    cj = 0
    ab = .join(('{}{}'.format(*t) for t in zip(A, B)))
    usernr = 0
    for i in range(len(pubkey)):
        if (pubkey[i] != pow(g, x, q)):
            cj = ((cj + C[i]) % q)
        else:
            usernr = i
    ci = (h2(((message + R) + ab)) - (cj % (q - 1)))
    C[usernr] = ci
    ti = ((ri - (C[usernr] * x)) % (q - 1))
    if (ti < 0):
        ti = ((q - 1) + ti)
    T[usernr] = ti
    ct = ','.join(('{},{}'.format(*t) for t in zip(C, T)))
    result = ((((((R + ',') + message) + ',') + str(pow(h1(mR), x, q))) + ',') + ct)
    if (verbose == True):
        print(('RingSign Result: ' + result))
        print('---- RingSign Completed ---- \n')
    return result