Suppose there is an array containing bytes 0...255. Suppose this array is shuffled using a key for random data.
Since this is indexing the elements of a table using secret data, is it vulnerable to timing attack?
If so, Suppose the array is shuffled again. Since the state at the beginning of the second shuffle is a secret, random permutation of bytes 0...255, is this second shuffle vulnerable to timing attack as well?
Basically, is the core of the problem accessing an index of an array based on secret data? Is knowing the contents of the array/table in question a prerequisite for this type of attack? Or is there something else to this altogether?
More specifically, I am curious about the vulnerability of following construction to timing attack:
shuffle(Z256, key) # this randomizes key too
output = Z256[Z256[index]] for index 0...255
The problems that I see are the indexing based on secret data, both during the shuffle and output stage. However, since the set is shuffled every time, the key randomized, and the set iterated through completely, I think it should be resistant? My reasoning is that since the set is iterated through completely, the sum of the time spent accessing it should be more or less the same regardless of the order the accesses happen in. But I'm not sure exactly what causes the vulnerability to begin with.