def test_encrypt_with_proofs_decrypt_and_check(self): m = randint(0,1) c,cproof,vproof = self.ppatspk.encryptwithproofs(m) d = self.ppatspk.derivCom(c) #print 'c',c #print 'd',d dec = self.ppatssk.decrypt(c) self.assertTrue(m==dec) self.assertTrue(nizk.consistencyProofCheck(self.ppatspk,c,cproof)) self.assertTrue(nizk.verifiabilityProofCheck(self.ppatspk,d,vproof))
def checkconsistproof(cce, consistproof): return nizk.consistencyProofCheck(self.publicKey, cce, consistproof)
def checkconsistproof(cce,consistproof): return nizk.consistencyProofCheck(self.publicKey,cce,consistproof)
def test_encrypt_with_consistency_check_proof(self): m = randint(1,self.maxmessage) c, cproof = self.ppatspk.encryptwithCproof(m) self.assertTrue(nizk.consistencyProofCheck(self.ppatspk,c,cproof))