def fromBytestoInt(b,k):
    """
    Convert a bytes array to a tuple of int ranging from 0 to 256**(k-1)
    """
    assert len(b)% k == 0
    i = 0
    ck = 0
    T = ()
    while i < len(b):
        nb = 0
        while ck < k :
            nb = nb + b[i]*(256**ck)
            i+=1
            ck+=1
        ck = 0
        T = T+(nb,)
    return T