def do_add_signature(input_file, output_file, signature_file):
signature = open(signature_file, '<STR_LIT:rb>').read()<EOL>if len(signature) == <NUM_LIT>:<EOL><INDENT>hash_algo = '<STR_LIT>'<EOL><DEDENT>elif len(signature) == <NUM_LIT>:<EOL><INDENT>hash_algo = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>raise ValueError()<EOL><DEDENT>with open(output_file, '<STR_LIT>') as dst:<EOL><INDENT>with open(input_file, '<STR_LIT:rb>') as src:<EOL><INDENT>add_signature_block(src, dst, hash_algo, signature)<EOL><DEDENT><DEDENT>
Add a signature to the MAR file.