def get_signature_data(fileobj, filesize):
<EOL>fileobj.seek(<NUM_LIT:0>)<EOL>marfile = mar.parse_stream(fileobj)<EOL>if not marfile.signatures:<EOL><INDENT>raise IOError("<STR_LIT>")<EOL><DEDENT>fileobj.seek(<NUM_LIT:0>)<EOL>block = fileobj.read(<NUM_LIT:8>)<EOL>yield block<EOL>sigs = sigs_header.parse_stream(fileobj)<EOL>sig_types = [(sig.algorithm_id, sig.size) for sig in sigs.sigs]<EOL>block = Int64ub.build(filesize) + Int32ub.build(sigs.count)<EOL>yield block<EOL>for algorithm_id, size in sig_types:<EOL><INDENT>block = Int32ub.build(algorithm_id) + Int32ub.build(size)<EOL>yield block<EOL><DEDENT>for block in file_iter(fileobj):<EOL><INDENT>yield block<EOL><DEDENT>
Read data from MAR file that is required for MAR signatures.

    Args:
        fileboj (file-like object): file-like object to read the MAR data from
        filesize (int): the total size of the file

    Yields:
        blocks of bytes representing the data required to generate or validate
        signatures.