Beispiel #1
0
q = 2**255 - 19
l = 2**252 + 27742317777372353535851937790883648493


if len(sys.argv) >= 2:
    if sys.argv[1] == "id":
        Translator.hexToC(MiniNero.identity())

    if sys.argv[1] == "smult":
        a= "87a61352d86f5cb0e9d227542b6b4870b9a327d082d15ea64e0494b9a896c1ac"
        aG = MiniNero.scalarmultBase(a)
        print(aG)
        print(MiniNero.scalarmultKey(aG, a))
    if sys.argv[1] == "add":
        #once it's good
        A = PaperWallet.pkGen()
        A = "75819750158570adc58ad6f932c3704661d6cd8eafd3a14818293a17790fbf71"
        B = PaperWallet.pkGen()
        B = "5fbc56c82c6e40596c673e301b63e100f08b97723ead425ed38f2b55c7a6454f"
        AB = MiniNero.addKeys(A, B)
        Translator.hexToC(A)
        Translator.hexToC(B)
        print(AB)
        AAB = MiniNero.addKeys(AB, A)
        print("AAB", AAB)
        print("hash")
        print(MiniNero.sc_reduce_key(MiniNero.cn_fast_hash(A)))
        aAbB = MiniNero.addKeys(MiniNero.scalarmultKey(A, A), MiniNero.scalarmultKey(B, B))
        print("testing addKeys3")
        print(aAbB)
Beispiel #2
0
def getKeyFromBlockchain(reference_index):
    #returns a ctkey a (randomly)
    rv = ctkey()
    rv.dest = PaperWallet.pkGen()
    rv.mask = PaperWallet.pkGen()
    return rv
Beispiel #3
0
def getKeyFromBlockchain(reference_index):
    #returns a ctkey a (randomly)
    rv = ctkey()
    rv.dest = PaperWallet.pkGen()
    rv.mask = PaperWallet.pkGen()
    return rv
Beispiel #4
0
b = 256
q = 2**255 - 19
l = 2**252 + 27742317777372353535851937790883648493

if len(sys.argv) >= 2:
    if sys.argv[1] == "id":
        Translator.hexToC(MiniNero.identity())

    if sys.argv[1] == "smult":
        a = "87a61352d86f5cb0e9d227542b6b4870b9a327d082d15ea64e0494b9a896c1ac"
        aG = MiniNero.scalarmultBase(a)
        print(aG)
        print(MiniNero.scalarmultKey(aG, a))
    if sys.argv[1] == "add":
        #once it's good
        A = PaperWallet.pkGen()
        A = "75819750158570adc58ad6f932c3704661d6cd8eafd3a14818293a17790fbf71"
        B = PaperWallet.pkGen()
        B = "5fbc56c82c6e40596c673e301b63e100f08b97723ead425ed38f2b55c7a6454f"
        AB = MiniNero.addKeys(A, B)
        Translator.hexToC(A)
        Translator.hexToC(B)
        print(AB)
        AAB = MiniNero.addKeys(AB, A)
        print("AAB", AAB)
        print("hash")
        print(MiniNero.sc_reduce_key(MiniNero.cn_fast_hash(A)))
        aAbB = MiniNero.addKeys(MiniNero.scalarmultKey(A, A),
                                MiniNero.scalarmultKey(B, B))
        print("testing addKeys3")
        print(aAbB)
import mnemonic
import PaperWallet
import Ecdh
import ASNL
import MLSAG
import MLSAG2
import LLW_Sigs
import RingCT
import Crypto.Random.random as rand
import Translator
import binascii
import RingCT2

#Schnorr NonLinkable true one and false one
x, P1 = PaperWallet.skpkGen()
P2 = PaperWallet.pkGen()
P3 = PaperWallet.pkGen()

L1, s1, s2 = ASNL.GenSchnorrNonLinkable(x, P1, P2, 0)

print("Testing Schnorr Non-linkable!")
print("This one should verify!")
print(ASNL.VerSchnorrNonLinkable(P1, P2, L1, s1, s2))
print("")
print("This one should NOT verify!")
print(ASNL.VerSchnorrNonLinkable(P1, P3, L1, s1, s2))

#ASNL true one, false one, C != sum Ci, and one out of the range..

print("\n\n\nTesting ASNL")
N = 10
import mnemonic
import PaperWallet
import Ecdh
import ASNL
import MLSAG
import MLSAG2
import LLW_Sigs
import RingCT
import Crypto.Random.random as rand
import Translator
import binascii
import RingCT2

#Schnorr NonLinkable true one and false one
x, P1 = PaperWallet.skpkGen()
P2 = PaperWallet.pkGen()
P3 = PaperWallet.pkGen()

L1, s1, s2 = ASNL.GenSchnorrNonLinkable(x, P1, P2, 0)

print("Testing Schnorr Non-linkable!")
print("This one should verify!")
print(ASNL.VerSchnorrNonLinkable(P1, P2, L1, s1, s2))
print("")
print("This one should NOT verify!")
print(ASNL.VerSchnorrNonLinkable(P1, P3, L1, s1, s2))

#ASNL true one, false one, C != sum Ci, and one out of the range..

print("\n\n\nTesting ASNL")
N = 10