Simplifying and solving a complex system of modular arithmetic expressions

43 Views Asked by At

I have the following system of 2 equations:

$1956483837 = (13179379638883309848L+(c_0+ 3048033998+1)+ 1)\ mod\ (2^{32} )$(1)

$2973671708 =(15447106725414132384+3912967674*((d_0+ 3659326121)\& 0xffffffff)+891235890+((((c_0+ 3048033998+ 1)\& 0xffffffff)+ 3048033998+ 1)\& 0xffffffff)+ 1) \ mod\ (2**32)$ (2)

The goal is to find $c_0$ and $d_0$.

I am facing 2 issues: the first is the fact that we have a modular component, the second that we have arithmetic & in the equation. My question is:

a) is there a way to further simplify the above

b) can it be easily solved, if yes how?

Edit: using z3 I came up with the following equations. Everything is known except $reala0$, $realc0$ and $reald0$:

rx1 = (h0_0*reala0+h2_0+(realc0+s_hi_int+1)+1)%(2**32)
rx2 = (2*r1*h1_0+2*r1*((reald0 + s_hi_int)%2**32)+h2_1+((((realc0 + s_hi_int+ 1)%2**32)+ s_hi_int+ 1)%2**32)+ 1)%(2**32)
rx3 = (h0_2*(h1_1 + (((((reald0 + s_lo_int)%2**32) + s_lo_int)%2**32)))+h2_2+((((((realc0 + s_hi_int + 1)%2**32)+ s_hi_int + 1)%2**32) + s_hi_int + 1)%2**32) + 0)%(2**32)

As background: this should prove to be an attack vector for the Middle Square Weyl sequence PRNG as described here