def _pad_data(data: bytes, n: int = 16) -> bytes:
    """
    Adds padding to the data according to the PKCS7 standard.
    Note that at least one byte of padding is guaranteed to be added.
    :param data: the data to pad
    :param n: the length to pad the data to, defaults to 16
    :return: the padded data
    """
    pad_len = n - (len(data) % n)
    return data + bytes([pad_len] * pad_len)