예제 #1
0
 def checkCondProof(com0,rproof,com):
     A = rproof[0] #TODO : check here
     res1 = com == A[1]
     res2 = True in nizk.base2RangeProofCheck(self.publicKey,com0,rproof)
     mexp = self.argsdict['max_exp_message_w']
     res3 = True in nizk.base2VerifExpoDecomp(self.publicKey,rproof,mexp)
     return res1 and res2 and res3
예제 #2
0
 def checkCondProof(com0,rproof,com):
     A = rproof[0] #TODO : check here
     res1 = com == A[1]
     res2 = True in nizk.base2RangeProofCheck(self.publicKey,com0,rproof)
     mexp = self.argsdict['max_exp_message_w']
     res3 = True in nizk.base2VerifExpoDecomp(self.publicKey,rproof,mexp)
     return res1 and res2 and res3
예제 #3
0
 def checkRangeProof(com,rproof):
     res1 = True in nizk.base2RangeProofCheck(self.publicKey,com,rproof)
     mexp = self.argsdict['max_exp_message_c']
     k = len(rproof)
     res2 = rproof[k-1][0] == 2**(mexp-1)
     for i in range(k-1):
         facti = rproof[i][0]
         res = facti == 2**i
         res2 = res2 and res
     return res1 and res2
예제 #4
0
 def checkRangeProof(com,rproof):
     res1 = True in nizk.base2RangeProofCheck(self.publicKey,com,rproof)
     mexp = self.argsdict['max_exp_message_c']
     k = len(rproof)
     res2 = rproof[k-1][0] == 2**(mexp-1)
     for i in range(k-1):
         facti = rproof[i][0]
         res = facti == 2**i
         res2 = res2 and res
     return res1 and res2
예제 #5
0
파일: auctions.py 프로젝트: vteague/PPAT
 def checkrangeproof(com, rproof):
     return True in nizk.base2RangeProofCheck(self.publicKey, com,
                                              rproof)
예제 #6
0
파일: auctions.py 프로젝트: vteague/PPAT
 def checkRangeproof(com, rproof):
     if not com == None and not rproof == None:
         return True in nizk.base2RangeProofCheck(
             self.publicKey, com, rproof)
     else:
         return True
예제 #7
0
 def checkrangeproof(com,rproof):
     return True in nizk.base2RangeProofCheck(self.publicKey,com,rproof)
예제 #8
0
 def checkRangeproof(com,rproof):
     if not com==None and not rproof==None :
         return True in nizk.base2RangeProofCheck(self.publicKey,com,rproof)
     else :
         return True
예제 #9
0
 def test_range_proof_on_commitment(self):
     m = randint(1,self.maxmessage)
     r = randint(1,self.n-1)
     com,r = self.ppatspk.commit(m,r)
     proof = nizk.base2RangeProof(self.ppatspk,com,m,r,self.maxexp,verif = True)
     self.assertTrue(nizk.base2RangeProofCheck(self.ppatspk,com,proof))
예제 #10
0
 def test_range_proof_on_commitment(self):
     m = randint(1,self.maxmessage)
     r = randint(1,self.n-1)
     com,r = self.ppatspk.commit(m,r)
     proof = nizk.base2RangeProof(self.ppatspk,com,m,r,self.maxexp,verif = True)
     self.assertTrue(nizk.base2RangeProofCheck(self.ppatspk,com,proof))