Cryptography Reference
In-Depth Information
The key and IV setups of HC-128 are performed in the key scheduling part
and given in Algorithm 10.1.1.
Input:
1. Secret key array K[0...3].
2. Initialization Vector IV [0...3].
Output: The internal state arrays P[0...511] and Q[0...511].
for i = 0,...,3 do
K[i + 4] = K[i];
IV [i + 4] = IV [i];
end
for i = 8,...,15 do
W[i] = K[i];
end
for i = 0,...,7 do
W[i] = IV [i−8];
end
for i = 16,...,1279 do
W[i] = f 2 (W[i−2]) + W[i−7] + f 1 (W[i−15]) + W[i−16] + i;
end
for i = 0,...,511 do
P[i] = W[i + 256];
end
for i = 0,...,511 do
Q[i] = W[i + 768];
end
for i = 0,...,511 do
P[i] =
P[i] + g 1 (P[i ⊟ 3],P[i ⊟ 10],P[i ⊟ 511])
⊕h 1 (P[i ⊟ 12]);
end
for i = 0,...,511 do
Q[i] =
Q[i] + g 2 (Q[i ⊟ 3],Q[i ⊟ 10],Q[i ⊟ 511])
⊕h 2 (Q[i ⊟ 12]);
end
Algorithm 10.1.1: HC-128 KSA
The keystream generation algorithm is presented in Algorithm 10.1.2.
It is not hard to see that the key and IV setup algorithm can be reversed,
if both the P,Q arrays are available after the key scheduling. This has also
been pointed out in [97].
Since P is used to denote an array in HC-128, we use Prob to denote
probability in this chapter.
Search WWH ::




Custom Search