I try to learn ElGamal re-encrypts scheme and I have a question about the example: How is a re-encryption done with elGamal?.
- The $g$ value of Alice must be the same as $g$ value of Bob or not?
- And what about of Prime $p$ value for Alice and Bob? Alice.$p$ must be the same as Bob.$p$ or not?
Thanks!
I try test it:
2. Bob reencrypts (x,w) as (x′,w′) with x′=xg^u, w′=wy^u(x′)^b.
I use BigInteger. I look that x1>0, ok but w1=0, becourse x1 > p:
var x1 = g.modPow(u, p).multiply(x);
var tmpB = y.modPow(u, p).multiply(w);
var w1 = x1.modPow(b,p).multiply(tmpB);
this w1 = 0
Where I mistake? – – Eugene Mar 29 '19 at 13:40