Beispiel #1
0
def genRCTSig(sk_x, sk_in, sk_out, Pk, CIn, COut, ExpIn, ExpOut, index):
    #sk_x is private keys of addresses (vector)
    #sk_in is masks of input commitments (vector)
    #sk_out is masks of output commitments (vector)
    #Pk is public key list (2d array)
    #CIn is input commitments (2d array)
    #COut is output commitments (vector)
    #ExpIn is exponents for the input commitments (2d array)
    #so each row of this is going to correspond to a column in the actual mlsag..
    #ExpOut is exponents for the output commitments
    #index is the secret index
    sk = sk_x[:]
    sk.append(
        MiniNero.sc_sub_keys(MiniNero.sc_add(sk_in, ExpIn[index]),
                             MiniNero.sc_add(sk_out, ExpOut)))
    CRow = [None] * len(CIn)  #commitments row of public keys Cin - Cout
    COutSum = sumCiExp(COut, ExpOut)  #Cout1*10^i_1 + Cout2 * 10^{i_2}..
    tmp = MiniNero.identity()
    pk = [None] * (len(sk_x) + 1)  #generalize later...
    pk[0] = Pk
    for i in range(0, len(CIn)):
        CRow[i] = MiniNero.subKeys(sumCiExp(CIn[i], ExpIn[i]), COutSum)
    pk[1] = CRow
    II, cc, ssVal = MLSAG.MLSAG_Sign(pk, sk, index)
    return pk, II, cc, ssVal
Beispiel #2
0
def genRCTSig(sk_x, sk_in, sk_out, Pk, CIn, COut, ExpIn, ExpOut, index):
    #sk_x is private keys of addresses (vector)
    #sk_in is masks of input commitments (vector)
    #sk_out is masks of output commitments (vector)
    #Pk is public key list (2d array)
    #CIn is input commitments (2d array)
    #COut is output commitments (vector)
    #ExpIn is exponents for the input commitments (2d array)
    #so each row of this is going to correspond to a column in the actual mlsag..
    #ExpOut is exponents for the output commitments
    #index is the secret index
    sk = sk_x[:]
    sk.append(MiniNero.sc_sub_keys(MiniNero.sc_add(sk_in, ExpIn[index]), MiniNero.sc_add(sk_out, ExpOut)))
    CRow = [None] * len(CIn) #commitments row of public keys Cin - Cout
    COutSum = sumCiExp(COut, ExpOut) #Cout1*10^i_1 + Cout2 * 10^{i_2}..
    tmp = MiniNero.identity()
    pk = [None] * (len(sk_x) + 1) #generalize later...
    pk[0] = Pk
    for i in range(0, len(CIn)):
        CRow[i] = MiniNero.subKeys(sumCiExp(CIn[i], ExpIn[i]), COutSum) 
    pk[1] = CRow
    II, cc, ssVal = MLSAG.MLSAG_Sign(pk, sk, index)
    return pk, II, cc, ssVal