I need help to understand how RC6 works. Many sites show that the maximum key size of RC6 is 2040 bits (255 Bytes). I can also have 0..255 rounds and 4 times 32bits words in the 128bit block variant or 4 times 64 bits Words in 256 bit variant. For this question assume 20 rounds
If expansion massive S[0,�,2r + 3] => max = 2*20+3=43 * 4bytes = 172bytes. If it is really possible to have a key consist of up to 255 bytes then array S is too small. Where does my calculation go wrong?
Input: User-supplied b byte key preloaded into the c - word array L[0,�,c-1]
Number r of rounds
Output: w-bit round keys S[0,�,2r + 3]
Procedure:
S[0] = Pw
for i = 1 to 2r + 3 do
S[i]=S[i-1]+Qw
A=B=i=j=0
v=3 ? max{c, 2r+4}
for s=1 to v do
{
A=S[i]=(S[i]+A+B)<<ɛ
B=L[j]=(L[j]+A+B)<<<(A+B)
i=(i+1) mod (2r+4)
j=(j+1) mod c
}