The definitions of the
and
functions are very similar;
is the same as
except that it treats its inputs in the opposite order,
and inverts one of them. If
did not apply bitwise inversion to its
first input (call this function
), then the two functions would be
related by
(with Swap having
the obvious definition
); this would mean in
turn that
for any
, and thus that
, with the result, as we shall see, that repeating
pairs were visible in the output roughly twice as often as they should be. The
inversion on the first input of
breaks this symmetry; however, it turns
out that it does not prevent a related attack.
Computation of PairCom requires 32 S-box lookups, but for each computation of
the
function the same 8-bit index, drawn from the least significant
byte, is fed to each of the four S-boxes. Changes to the other bytes carry directly
into the output of
, without nonlinearity or mixing; in other words,
where
, we find
. We call this least significant
byte the index to the S-box. If
is the input to PairCom,
only bytes
of
are indices to S-boxes in
,
and only bytes
are indices in
; by inverting only
these two bytes in our pair
, we can avoid the symmetry-breaking
effect of the inversion as far as the nonlinear components are concerned, which
results in the same four S-box indices being used in both the
and
branches of PairCom.
|
Figure 3 illustrates this attack. For an arbitrary
-bit
string
, we define symbols for intermediate
values in
:
With these definitions, we find that
:
From this it is clear that for any input of the appropriate form, one output
word is the inverse of the other; or in other words, if we now XOR the two word
outputs from PairCom together (which, conveniently, is the same as applying
the LEVIATHAN compression function
a second time), we find
Since we model LevAbove as a random function we conclude that inputs to PairCom
have probability
of matching this form in the normal calculation
of LevPair. Where inputs do not match this form, we assume that PairCom behaves
as a random function and therefore that for random
not matching
this form,
;
this assumption is borne out by experiment. From this we conclude that LevPair
is twice as likely as a random function to produce an output
such that
For
, a test for the presence of this bias should therefore take
on the order of
samples of LevPair, ie
bytes, as
for the previous attack.