def permutation(block, arr, n):
	"""
	Return a permutated array of the passed bit block array, according to the passed permutation array, up to n bits
	
		Parameters:
			block (list): array to be permutated
			arr: (list): order of permutation
			n (int): the number of bits to be permuted
			
		Return:
			(list): permutated array
	"""
	permut = []
	for i in range(n):
		permut.append(block[arr[i] - 1])
	return permut