docs: def check_encoding(proof_req: dict, proof: dict) -> bool:
          """
          Return whether the proof's raw values correspond to their encodings
          as cross-referenced against proof request.
  
          :param proof request: proof request
          :param proof: corresponding proof to check
          :return: True if OK, False for encoding mismatch
          """
  
          LOGGER.debug('Verifier.check_encoding <<< proof_req: %s, proof: %s', proof_req, proof)
  
          cd_id2proof_id = {}  # invert proof['identifiers'] per cd_id
          p_preds = {}  # cd_id and attr to bound
          for idx in range(len(proof['identifiers'])):
              cd_id = proof['identifiers'][idx]['cred_def_id']
              cd_id2proof_id[cd_id] = idx  # since at most 1 cred per cred def
              p_preds[cd_id] = {
                  ge_proof['predicate']['attr_name']: ge_proof['predicate']['value']
                  for ge_proof in proof['proof']['proofs'][idx]['primary_proof']['ge_proofs']
              }
  
          for (uuid, req_attr) in proof_req['requested_attributes'].items():  # proof req xref proof per revealed attr
              canon_attr = canon(req_attr['name'])
              proof_ident_idx = cd_id2proof_id[req_attr['restrictions'][0]['cred_def_id']]
              enco = proof['proof']['proofs'][proof_ident_idx]['primary_proof']['eq_proof']['revealed_attrs'].get(
                  canon_attr)
              if not enco:
                  continue  # requested but declined from revelation in proof: must appear in a predicate
              if enco != proof['requested_proof']['revealed_attrs'][uuid]['encoded']:
                  LOGGER.debug('Verifier.check_proof_encoding <<< False')
                  return False
              if enco != encode(proof['requested_proof']['revealed_attrs'][uuid]['raw']):
                  LOGGER.debug('Verifier.check_proof_encoding <<< False')
                  return False
  
          for (uuid, req_pred) in proof_req['requested_predicates'].items():  # proof req xref proof per pred
              canon_attr = canon(req_pred['name'])
              if p_preds[req_pred['restrictions'][0]['cred_def_id']].get(canon_attr) != req_pred['p_value']:
                  LOGGER.debug('Verifier.check_proof_encoding <<< False')
                  return False
  
          LOGGER.debug('Verifier.check_proof_encoding <<< True')
          return True