Пример #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
 def checkrangeproof(com, rproof):
     return True in nizk.base2RangeProofCheck(self.publicKey, com,
                                              rproof)
Пример #6
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
Пример #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))