public static byte[] revert10padding(byte[] input) throws InputMismatchException{
		// An empty input array does not fulfil the requirements.
		// Even an empty message would be padded to [1].
		if(input.length == 0) {
			throw new InputMismatchException("The provided input is malformed.");
		}

		int paddingStart = input.length - 1;
		for(; input[paddingStart] == 0; paddingStart--) {
			if(paddingStart == 0) {
				// In this case we went through the whole array without encountering anything
				// but 0's. This does not fulfil the requirements
				return null;
			}
		}
		// Check if we found a 1 now.
		if(input[paddingStart] == 1) {
			// That fulfills the padding pattern.
			// Copy the remaining input
			byte[] output = new byte[paddingStart];
			for(int i = 0; i < paddingStart; i++) {
				output[i] = input[i];
			}
			return output;
		} else {
			throw new InputMismatchException("The provided input is malformed.");
		}
	}