def format_hash(digest, hash_algo):
prefixes = {<EOL>'<STR_LIT>': b'<STR_LIT>',<EOL>'<STR_LIT>': b'<STR_LIT>',<EOL>}<EOL>return prefixes[hash_algo] + digest<EOL>
Format a hash as an ASN1 DigestInfo byte string.

    Args:
        digest (bytes): hash digest
        hash_algo (str): hash algorithm used, e.g. 'sha384'

    Returns:
        Byte string of ASN1 encoded digest info