diff --git a/MLSAG.py b/MLSAG.py index bb25628..3ff6389 100644 --- a/MLSAG.py +++ b/MLSAG.py @@ -9,7 +9,7 @@ def keyImage(x, rows): HP = keyVector(rows) KeyImage = keyVector(rows) for i in range(0, rows): - HP[i] = MiniNero.hashToPoint_cn(MiniNero.scalarmultBase(x[i])) + HP[i] = MiniNero.hashToPointCN(MiniNero.scalarmultBase(x[i])) KeyImage[i] = MiniNero.scalarmultKey(HP[i], x[i]) return KeyImage @@ -20,14 +20,14 @@ def MLSAG_Sign(pk, xx, index): L = [[None] * cols] #list of keyvectors? except it's indexed by cols... it's kind of internal actually R = [[None] * cols] s = [[PaperWallet.skGen() for i in range(0, cols)] ] #first index is rows, second is cols, wonder if I should switch that.. - HP = [[MiniNero.hashToPoint_cn(i) for i in pk[0]]] + HP = [[MiniNero.hashToPointCN(i) for i in pk[0]]] pj = ''.join(pk[0]) for i in range(1, rows): L.append([None] * cols) R.append([None] * cols) s.append([PaperWallet.skGen() for j in range(0, cols)]) - HP.append([MiniNero.hashToPoint_cn(j) for j in pk[i]]) + HP.append([MiniNero.hashToPointCN(j) for j in pk[i]]) pj = pj + ''.join(pk[i]) c= [None] * cols #1-dimensional @@ -64,9 +64,9 @@ def MLSAG_Ver(pk, keyimage, c1, s ): R.append([None] * cols) pj = pj + ''.join(pk[i]) c= [None]*(cols+1) #you do an extra one, and then check the wrap around - HP = [[MiniNero.hashToPoint_cn(i) for i in pk[0]]] + HP = [[MiniNero.hashToPointCN(i) for i in pk[0]]] for j in range(1, rows): - HP.append([MiniNero.hashToPoint_cn(i) for i in pk[j]]) + HP.append([MiniNero.hashToPointCN(i) for i in pk[j]]) c[0] = c1 j = 0 while j < cols: diff --git a/mininero.py b/MiniNero.py similarity index 100% rename from mininero.py rename to MiniNero.py diff --git a/RingCT.py b/RingCT.py index cce28e9..b10c729 100644 --- a/RingCT.py +++ b/RingCT.py @@ -2,7 +2,7 @@ import MLSAG import LLW_Sigs import PaperWallet -import AggregateSchnorr +import ASNL import Ecdh import Translator @@ -72,7 +72,7 @@ def genRangeProof(b, digits): a = MiniNero.addScalars(a, ai[i]) #creating the total mask since you have to pass this to receiver... Ci[i] = MiniNero.addKeys(MiniNero.scalarmultBase(ai[i]), MiniNero.scalarmultKey(getHForCT(), MiniNero.intToHex(bb[i] * 2 ** i))) CiH[i] = MiniNero.subKeys(Ci[i], MiniNero.scalarmultKey(getHForCT(), MiniNero.intToHex(2 ** i))) - L1, s2, s = AggregateSchnorr.GenASNL(ai, Ci, CiH, bb) + L1, s2, s = ASNL.GenASNL(ai, Ci, CiH, bb) return sumCi(Ci), Ci, L1, s2, s, a def verRangeProof(Ci, L1, s2, s): @@ -80,10 +80,10 @@ def verRangeProof(Ci, L1, s2, s): CiH = [None] * n for i in range(0, n): CiH[i] = MiniNero.subKeys(Ci[i], MiniNero.scalarmultKey(getHForCT(), MiniNero.intToHex(2 ** i))) - return AggregateSchnorr.VerASNL(Ci, CiH, L1, s2, s) + return ASNL.VerASNL(Ci, CiH, L1, s2, s) def ComputeReceivedAmount(senderEphemPk, receiverSK, maskedMask, maskedAmount, Ci, exponent): - ss1, ss2 = ecdh.ecdhretrieve(receiverSK, senderEphemPk) + ss1, ss2 = Ecdh.ecdhRetrieve(receiverSK, senderEphemPk) mask = MiniNero.sc_sub_keys(maskedMask, ss1) CSum = sumCi(Ci) bH = MiniNero.subKeys(CSum, MiniNero.scalarmultBase(mask)) #bH = C - aG