def sig_blob_matches(sig_blobs, public_pair_blobs, tmp_script, signature_for_hash_type_f,
                     flags, exit_early=False):
    """
    sig_blobs: signature blobs
    public_pair_blobs: a list of public pair blobs
    tmp_script: the script as of the last code separator
    signature_for_hash_type_f: signature_for_hash_type_f
    flags: verification flags to apply
    exit_early: if True, we may exit early if one of the sig_blobs is incorrect or misplaced. Used
                   for checking a supposedly validated transaction. A -1 indicates no match.

    Returns a list of indices into public_pairs. If exit_early is True, it may return early.
    If sig_blob_indices isn't long enough or contains a -1, the signature is not valid.
    """

    strict_encoding = not not (flags & VERIFY_STRICTENC)

    # Drop the signatures, since there's no way for a signature to sign itself
    for sig_blob in sig_blobs:
        tmp_script = delete_subscript(tmp_script, bin_script([sig_blob]))

    sig_cache = {}
    sig_blob_indices = []
    ppb_idx = -1

    while sig_blobs and len(sig_blobs) <= len(public_pair_blobs):
        if exit_early and -1 in sig_blob_indices:
            break
        sig_blob, sig_blobs = sig_blobs[0], sig_blobs[1:]
        try:
            sig_pair, signature_type = parse_signature_blob(sig_blob, flags)
        except (der.UnexpectedDER, __HOLE__):
            sig_blob_indices.append(-1)
            continue

        if signature_type not in sig_cache:
            sig_cache[signature_type] = signature_for_hash_type_f(signature_type, script=tmp_script)

        try:
            ppp = ecdsa.possible_public_pairs_for_signature(
                ecdsa.generator_secp256k1, sig_cache[signature_type], sig_pair)
        except ecdsa.NoSuchPointError:
            ppp = []

        while len(sig_blobs) < len(public_pair_blobs):
            public_pair_blob, public_pair_blobs = public_pair_blobs[0], public_pair_blobs[1:]
            ppb_idx += 1
            if strict_encoding:
                check_public_key_encoding(public_pair_blob)
            try:
                public_pair = sec_to_public_pair(public_pair_blob, strict=strict_encoding)
            except EncodingError:
                public_pair = None
            if public_pair in ppp:
                sig_blob_indices.append(ppb_idx)
                break
        else:
            sig_blob_indices.append(-1)
    return sig_blob_indices
dataset/ETHPy150Open richardkiss/pycoin/pycoin/tx/script/check_signature.py/sig_blob_matches