The code bellow is the RC5 encryption pseudo code in C language.
What is the error?
LE0 = A + S[0];
RE0 = B + S [1];
for i = 1 to r do
LEi = ((LEi-1 ⊕ REi-1) >>> REi-1) + S [2xi];
REi = ((REi-1 ⊕ LEi) <<< LEi) + S [2xi+1];
(a) The left shift operation (should be right shift)
(b) The right shift operation (should be left shift)
(c) LEi-1 and REi-1 should be LEi and REi
(d) The for loop runs from 1 to r-1 ( not 1 to r)
The question was posed to me during an online exam.
Question is taken from RC4 and RC5 topic in portion Pseudorandom Number Generation and Stream Ciphers and More Block Ciphers of Cryptograph & Network Security