I understand that if DDH (Decisional Diffie–Hellman) is hard then ElGamal is CPA secure. But I'm having confusion on what part the DDH applies to.
So, given $pk=(G, g, y), y=g^x$ and $sk=(pk,x), x \leftarrow Z_q$
Encryption: pick random $r \leftarrow Z_q$ then $(u,v)=(g^r, y^rm)$
Decryption: $m=u^{-x}v$ because $u^{-x}v=(g^r)^{-x}y^rm=(g^x)^{-r}y^rm=(y)^{-r}y^r=m$
From here, it says that:
Given some group $G$ and group elements $g$, and the elements $g^a$, $g^b$ and $g^c$, determine whether $g^c = g^{ab}$
I'm not understanding where this is applied to. I think it is at the decryption part but have more confusion of whether it is a DDH or CDH problem. Could someone highlight which part the $g^a$, $g^b$ and $g^c$?