I want to prove:
Let $d\in\mathbb{N}$ be square-free.
If $x^2-dy^2 = -1$ has a solution in $\mathbb{Z^2}$, then $d$ is the sum of two coprime squares.
I've already shown, that the equation has no solution if there exists a prime $p$ dividing $d$ with $p\equiv 3 \text{ mod } 4$. I would appreciate any hints.



If $x^2-dy^2=-1$ then,
$$x^2\equiv -1 \pmod p$$ for all primes $p$ which divide $d$. This is equivalent to $p\equiv 1\pmod 4$ which in turn is known to be equivalent to $p=a^2+b^2$. Since this holds for each prime divisor of $d$ it holds also for $d$.