def verify_proof(self, env, sig, message="", strict=True):
        """Verifies a proof within an environment of assigned public only variables."""

        ## Select the constants for the env
        env_l = [(k,v) for  k,v in env.items() if k in self.Const]
        
        if __debug__ and strict:
            env_not = [k for k,v in env.items() if k not in self.Const]
            if len(env_not):
                raise Exception("Did not check: " + (", ".join(env_not)))

        c, responses = sig
        responses = dict(list(responses.items()) + env_l)

        ## Ensure all variables we need are here
        self._check_env(responses)

        ## Define the maths group we work in
        G = self.G
        order = G.order()

        ## Make a list of all the public state
        state = ['ZKP', G.nid(), message]
        for v in sorted(self.Const.keys()):
            state += [responses[v]]
        for v in sorted(self.Pub.keys()):
            state += [responses[v]]

        ## Compute the first message and add it to the state
        for base, expr in self.proofs:
            Cr = expr.val(responses)
            Cx = base.val(responses)
            Cw = Cr + c * Cx
            state += [Cw]
         
        ## Compute the challenge using all the state
        hash_c = challenge(state)
        c_prime = Bn.from_binary(hash_c) % order

        ## Check equality
        return (c == c_prime)
dataset/ETHPy150Open gdanezis/petlib/examples/genzkp.py/ZKProof.verify_proof/original