Evaluating $\left(\frac{-2}{p}\right)$ 
Prove that for $p\ge 3$, a prime: $$\left(\frac{-2}{p}\right) = \begin{cases}
1 & p\equiv1,3\pmod{8}\\
-1 & p\equiv-1,-3\pmod{8}
\end{cases}$$

I already now that:
$$\left(\frac{-2}{p}\right)=\left(\frac{-1}{p}\right)\left(\frac{2}{p}\right)=(-1)^{\frac{p-1}{2}}(-1)^{\frac{p^{2}-1}{8}}=(-1)^{\frac{(p-1)(p^{2}-1)}{8}}=(-1)^{\frac{p-1}{2}\cdot\frac{p+1}{2}\cdot\frac{p-1}{4}}$$
And I'm trying to show when the exponent is even (for the $1$ case).
We have:


*

*$\frac{p-1}{4} = 2k \implies p- 1 = 8k \implies p = 8k + 1$. So we can infer that if $p\equiv 1\pmod{8}$ then $\left( \frac{-2}{p} \right)=1$

*$\frac{p-1}{2}$ - doesn't yield anything new to us (I think)

*$\frac{p+1}{2} = 2t \implies p+1 = 4t \implies p = 4t-1$


but I don't really see how to infer the other option $(p \equiv 3 \pmod{8})$

$p=4t-1=4(t-1)+3$, so $p=3$ mod 4. Modulo 8 there are two possibilities:
1) $p=3$ (mod 8)
2) $p=7$ (mod 8)
By plugging in the numbers, 2) doesn't work, and 1) work
Edit:
There seems to be a mistake, remember that $(-1)^\frac{p-1}{2}(-1)^\frac{p^2-1}{8}=(-1)^{\frac{p-1}{2}+\frac{p^2-1}{8}}=(-1)^\frac{(p-1)(p+5)}{8}$
