Let $p$ be a fixed prime number $>3$. The motivation for asking the question below is the coincidence of the following two numbers. Namely, the number $h_p^{(1)}$ of supersingular $j$-invariants belonging to the prime field $F_p$, and half of the number $\Sigma_p$ of isomorphism classes classes of complex elliptic curves $E$ so that the imaginary quadratic order $\mathbf{Z}[\sqrt{-p}]$ embeds in the ring $\textrm{End}_\mathbf{C}(E)$.

Explicitly, if $h(\sqrt{-p})$ denotes the class number of $Q(\sqrt{-p})$, then

$h_p^{(1)}=\Sigma_p/2=h(\sqrt{-p})/2$, when $p\equiv 1$ $\mod$ $4$;

$h_p^{(1)}=\Sigma_p/2=2h(\sqrt{-p})$, when $p\equiv 3$ $\mod$ $8$;

$h_p^{(1)}=\Sigma_p/2=h(\sqrt{-p})$, when $p\equiv 7$ $\mod$ $8$.

Proving that $\Sigma_p/2$ is equal to the function of $h(\sqrt{-p})$ above is elementary. On the other hand, the fact that $h_p^{(1)}$ is also given by the same function of $h(\sqrt{-p})$ is harder, and a possible proof follows from Eichler's trace formula relating traces of Hecke operators on $S_2(\Gamma_0(p),\mathbf{C})$ to those of Brandt matrices (cf. Gross, Heights and the Special Values of L-series, formula (1.10)).

My question is: is there a direct way of showing that $h_p^{(1)}=\Sigma_p/2$?

My naive thought about it is that one could try to study the reduction mod $p$ of suitable models of the elliptic curves $E$ with complex multiplication by $\sqrt{-p}$ and see what kind of (supersingular?) elliptic curves do arise, hoping that the map on $j$-invariants is 2-to-1. One could ask even more: for any supersingular elliptic curve $E$ over $F_p$ with Frobenius satisfying $X^2+p$, can we find a lifting to an elliptic curve $E'$ over an extension of $Q_p$ that depends functorially on $E$? (The functoriality requirement is not perhaps an "a-priori" nonsense since the endomorphism ring of $E$ over $F_p$ is just an imaginary quadratic order (containing $\sqrt{-p}$)). I do not know enough about lifting of elliptic curves to say how reasonable these questions are. If some of you has more structured and elaborated thoughts on the matter, then I would like to hear them! Thanks in advance.