示例#1
0
    def prover_state1(self):
        print("PROVER 1: ")
        (g, V) = Sigma.get(self, ['g', 'V'])
        r = self.group.random(G2)
        a1 = pair(g, r)
        a2 = pair(V, r)
        print("send r =>", r)
        print("send a1 =>", a1)
        print("send a2 =>", a2)
        pk = Sigma.get(self, ['g', 'V', 'H'], dict)

        Sigma.store(self, ('r', r))
        Sigma.setState(self, 3)
        return {'a1': a1, 'a2': a2, 'pk': pk}
示例#2
0
文件: sigma3.py 项目: FinalF/charm
    def prover_state1(self):
        print("PROVER 1: ")
        (g, V) = Sigma.get(self, ['g', 'V'])
        r = self.group.random(G2)
        a1 = pair(g, r)
        a2 = pair(V, r)
        print("send r =>", r)
        print("send a1 =>", a1)
        print("send a2 =>", a2)
        pk = Sigma.get(self, ['g','V','H'], dict)

        Sigma.store(self, ('r',r) )
        Sigma.setState(self, 3)
        return { 'a1':a1, 'a2':a2, 'pk':pk }
示例#3
0
文件: sigma2.py 项目: wuquanda/abe_py
    def prover_state1(self):
        print("PROVER 1: ")
        (g, V) = Sigma.get(self, ['g', 'V'])
        r1, r2 = self.group.random(ZR, 2)

        a = (pair(V, g)**-r1) * (pair(g, g)**r2)
        print("send g =>", g)
        print("send V =>", V)
        print("send r1 =>", r1)
        print("send r2 =>", r2)
        print("send a =>", a)

        pk = Sigma.get(self, ['g', 'V', 'y'], dict)
        Sigma.store(self, ('r1', r1), ('r2', r2))
        Sigma.setState(self, 3)
        return {'a': a, 'pk': pk}
示例#4
0
文件: sigma2.py 项目: FinalF/charm
    def prover_state1(self):
        print("PROVER 1: ")
        (g, V) = Sigma.get(self, ['g', 'V'])
        r1, r2 = self.group.random(ZR, 2)

        a = (pair(V, g) ** -r1) * (pair(g, g) ** r2)
        print("send g =>", g)
        print("send V =>", V)
        print("send r1 =>", r1)
        print("send r2 =>", r2)
        print("send a =>", a)

        pk = Sigma.get(self, ['g','V','y'], dict)
        Sigma.store(self, ('r1',r1), ('r2',r2) )
        Sigma.setState(self, 3)
        return { 'a':a, 'pk':pk }