Consider this random generator function.
A simplified version is provided below (this is C++, mind that "seed" is a reference):
uint32_t Rand(uint64_t& seed)
{
seed = 1683268614LL * (seed & 0xffffffff) + (seed >> 32);
return seed & 0xffffffff;
}
For those unfamiliar with C++: &
denotes bit-wise AND, LL
as a suffix denotes signed long long
(signed 64-bit usually), >>
denotes plain bit-shift, the uint64_t&
in the header denotes that the input is a reference to an unsigned 64-bit integer, that is, updates also apply outside the function.
This is almost a linear congruential generator (LCG), the only difference is that the increment is not a constant, but a part of the seed itself.
My question is on the security of this algorithm, since LCGs are very easy to break.
Does using a non constant increment improve or decrease security? How could this be cracked other than by bruteforceing it?
seed
nor the other intermediate values exceed the representable range of signed 64-bit integers. $\endgroup$