def _unpad_data(data: bytes) -> bytes:
    """
    Removes padding from the data according to PKCS7 standard and returns data such that
    len(new_data) = len(data) - pad_len
    :param data: the data to unpad
    :return: the original data without padding
    """
    return data[:-data[-1]]