If we have four complex values, all of the form $a + b i$, for integers $a$ and $b$, we can label them $c$, $d$, $e$ and $f$. Now if we want to find $g$ and $h$ such that
$$g \equiv ce \equiv df \mod p$$ $$\text{and}$$ $$h \equiv de \equiv cf \mod p$$ $$\text{and}$$ $$g \ne h \mod p$$
I'm wondering what values we can get for $g$ and $h$, given that we can pick any $c$, $d$, $e$ and $f$, or what form they'll take.
UPDATE
I believe that we can have any combination (of $g$ and $h$) that satisfies $g^2 \equiv (h^2) \mod p$. Can anyone prove this?
AN EXAMPLE
For instance, if we pick $c=i, d=4i, e=i, f=4i$ we get $$g \equiv -1 \mod p$$ and $$h \equiv 1 \mod p$$.
WHAT I'M LOOKING FOR
I'm looking to find every possible combination of $g$ and $h$, or what form the two will take on.
PROBLEM SOURCE
The formulas come from observing the following multiplications:
$$ \begin{array}{c|c|c} * & c & d \\ \hline e & ce & de \\ \hline f & cf & df \end{array} $$
What we're after, then, is:
$$ \begin{array}{c|c|c} * & c & d \\ \hline e & g & h \\ \hline f & h & g \end{array} $$
Here is a possible proof to the question - I need someone to check my work.
We start with $g \equiv ce \equiv df \mod p$. So
$$\begin{align} ce &\equiv df \mod p \\ c &\equiv df/e \tag{1} \end{align}$$
We also have $h \equiv de \equiv cf \mod p$. So
$$\begin{align} de &\equiv (c)f \mod p \\ &\equiv (df/e)f \qquad \text{using (1)}\\ &\equiv df^2/e \\ e &\equiv f^2/e \\ e^2 &\equiv f^2 \mod p \tag{2} \end{align}$$
Now if we start with:
$$ \begin{align} (ce)^2 &\equiv c^2 e^2 \\ &\equiv c^2 f^2 \qquad \text{ from (2)} \\ (ce)^2 &\equiv (cf)^2 \\ g^2 &\equiv h^2 \end{align} $$
Could someone please verify that this is correct?