当前位置: 首页>>代码示例>>Python>>正文


Python MiniNero.hashToPoint_ct方法代码示例

本文整理汇总了Python中MiniNero.hashToPoint_ct方法的典型用法代码示例。如果您正苦于以下问题:Python MiniNero.hashToPoint_ct方法的具体用法?Python MiniNero.hashToPoint_ct怎么用?Python MiniNero.hashToPoint_ct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MiniNero的用法示例。


在下文中一共展示了MiniNero.hashToPoint_ct方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getHForCT

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import hashToPoint_ct [as 别名]
def getHForCT():
    return "8b655970153799af2aeadc9ff1add0ea6c7251d54154cfa92c173a0dd39c1f94"
    A = MiniNero.publicFromInt(1)
    H = MiniNero.hashToPoint_ct(A)
    Translator.hexToC(H) 
    print(H)
    return H
开发者ID:ShenNoether,项目名称:research-lab,代码行数:9,代码来源:RingCT2.py

示例2: getH2ForCT

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import hashToPoint_ct [as 别名]
def getH2ForCT():
    A = MiniNero.publicFromInt(1)
    HPow2 = MiniNero.hashToPoint_ct(A)
    two = MiniNero.intToHex(2)
    H2 = [None] * ATOMS
    for i in range(0, ATOMS):
        #Translator.hexToCComma(HPow2) 
        H2[i] = HPow2
        HPow2 = MiniNero.scalarmultKey(HPow2, two)
    return H2
开发者ID:ShenNoether,项目名称:research-lab,代码行数:12,代码来源:RingCT2.py

示例3: LLW_Ver

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import hashToPoint_ct [as 别名]
def LLW_Ver(pk, keyimage, c1, s):
    n= len(pk) #ok
    print("verifying LLW sig of length", n)
    L = [None]*n
    R = [None]*n
    c= [None]*(n+1)
    pj = ''.join(pk)
    HP = [MiniNero.hashToPoint_ct(i) for i in pk]
    c[0] = c1
    j = 0
    while j < n:
        L[j] = MiniNero.addKeys(MiniNero.scalarmultBase(s[j]), MiniNero.scalarmultKey(pk[j], c[j]))
        R[j] = MiniNero.addKeys(MiniNero.scalarmultKey(HP[j], s[j]), MiniNero.scalarmultKey(keyimage, c[j]))
        cj = j + 1
        c[cj] = MiniNero.cn_fast_hash(pj + L[j] + R[j])
        j = cj
    rv = (c[0] == c[n])
    print("sig verifies complete", rv)
    print("c", c)
    print("L", L)
    print("R", R)
    return rv
开发者ID:Coder420,项目名称:MiniNero,代码行数:24,代码来源:LLW_Sigs.py

示例4: LLW_Sig

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import hashToPoint_ct [as 别名]
def LLW_Sig(pk, xx, index ):
    n = len(pk)
    print("Generating LLW sig of length ", n)
    L = [None] * n
    R = [None] * n
    c= [None] * n
    s = [PaperWallet.skGen() for i in range(0, n)] 
    HP = [MiniNero.hashToPoint_ct(i) for i in pk]
    pj = ''.join(pk)
    keyimage = keyImage(xx) #ok
    s[index] = MiniNero.mul_8(s[index])
    L[index] = MiniNero.scalarmultBase(s[index])
    R[index] = MiniNero.scalarmultKey(HP[index], s[index]) #aH
    j = (index + 1) % n
    c[j] = MiniNero.cn_fast_hash(pj+L[index]+R[index])
    while j != index:
        L[j] = MiniNero.addKeys(MiniNero.scalarmultBase(s[j]), MiniNero.scalarmultKey(pk[j], c[j])) #Lj = sG + cxG
        R[j] = MiniNero.addKeys(MiniNero.scalarmultKey(HP[j], s[j]), MiniNero.scalarmultKey(keyimage, c[j])) #Rj = sH + cxH
        cj = (j + 1) % n
        c[cj] = MiniNero.cn_fast_hash(pj + L[j] + R[j]) #c j+1 = H(pk + Lj + Rj
        j = cj #increment j
    s[index] = MiniNero.sc_mulsub_keys(s[index], c[index], xx) #si = a - c x so a = s + c x
    print("sigma = ", keyimage, c[0], s[:])
    return keyimage, c[0], s[:]
开发者ID:Coder420,项目名称:MiniNero,代码行数:26,代码来源:LLW_Sigs.py

示例5: keyImage

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import hashToPoint_ct [as 别名]
def keyImage(x):
    HP = MiniNero.hashToPoint_ct(MiniNero.scalarmultBase(x))
    return MiniNero.scalarmultKey(HP, x)
开发者ID:Coder420,项目名称:MiniNero,代码行数:5,代码来源:LLW_Sigs.py

示例6: getHForCT

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import hashToPoint_ct [as 别名]
def getHForCT():
    A = MiniNero.publicFromInt(123456)
    return MiniNero.hashToPoint_ct(A)
开发者ID:Coder420,项目名称:MiniNero,代码行数:5,代码来源:GenLookup.py

示例7: print

# 需要导入模块: import MiniNero [as 别名]
# 或者: from MiniNero import hashToPoint_ct [as 别名]
     a = MiniNero.electrumChecksum(t)
     print(a)
 if sys.argv[1] == "1224":
     #sohuld turn 12 word key to 24
     print("tbd")
     sk = "536313cc0a88457e3d3e5aadda8d204af20e480416cc522ebd5a67df00ce2503"
     print(MiniNero.getAddr(sk))
 if sys.argv[1] == "seed":
     seed = "3c817618dcbfed122a64e592bb441d73300da9123686224a84e0eab1f075117e";
     a = MiniNero.hexToInt(seed)
     b = a // l
     print(b)
 if sys.argv[1] == "HCT":
     for i in [1, 12, 123, 1234, 12345, 123456]:
         A = MiniNero.publicFromInt(i)
         print(i, MiniNero.hashToPoint_ct(A))
 if sys.argv[1] == "RingCTSimple":
     #see below for ring ct with sliding exponents
     exponent = 9
     H_ct = RingCT.getHForCT()
     print("H", H_ct)
     sr, Pr = PaperWallet.skpkGen() #receivers private/ public
     se, pe, ss1, ss2 = Ecdh.ecdhGen(Pr) #compute shared secret ss
     digits = 32 #in practice it could will be 32 (from .0001 monero to ~400k monero) all other amounts can be represented by full 64 if necessary, otherwise you can use the sliding implementation of RingCT given below.
     print("inputs")
     a = 10000
     Cia, L1a, s2a, sa, ska = RingCT.genRangeProof(10000, digits)
     print("outputs")
     b = 7000
     Cib, L1b, s2b, sb, skb = RingCT.genRangeProof(7000, digits)
     c = 3000
开发者ID:ShenNoether,项目名称:research-lab,代码行数:33,代码来源:Test.py


注:本文中的MiniNero.hashToPoint_ct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。