import struct


def pack_nist_signature(msg: bytes, sig: bytes) -> bytes:
    """Pack message and signature with the encoding of the NIST PQC competition"""

    return struct.pack("<I{}B{}B".format(len(msg), len(sig)), len(sig), *msg, *sig)