Number of solutions $N$ to $x^2+yz=1$ (mod $p$) where $p>2$ and $p$ is a prime. Where is my mistake?
From my lecture notes I know that: ($e(z)=e^{2\pi i z}$) $$ N = p^{-1}\sum_{k=0}^{p-1}\sum_{x=1}^{p}\sum_{y=1}^{p}\sum_{z=1}^{p}e(k(x^2+yz-1)/p). $$ $$ = p^{-1}\sum_{k=0}^{p-1}e(-k/p)\sum_{x=1}^{p} e(kx^2/p)\sum_{y=1}^{p}\sum_{z=1}^{p}e(kyz/p) $$ In the next step I use two lemmas proved before that say $$ \sum_{y=1}^{p}\sum_{z=1}^{p}e(kyz/p) = p (k,p) \quad ((k,p)=gcd(k,p)) $$ and $$ (*) \quad \sum_{x=1}^{p} e(kx^2/p) = G(k,p), \quad G(k,p)=\sum_{a=1}^{p} \left( \frac{a}{p} \right) e(ak/p) $$ So now $N$ becomes $$ =p^{-1}\sum_{k=0}^{p-1}e(-k/p) G(k,p) \, p \,(k,p) $$ And writing the Gauss sum (The fraction is Legendre symbol) with its definition (above), changing order of summation and noting that $(k,p)=1$ gives $$ =\sum_{a=1}^{p} \left( \frac{a}{p} \right) \sum_{k=0}^{p-1}e(k(a-1)/p) $$ Which equals $0$ because the inner sum is $0$ except when $p|(a-1)$ which never happens.
There must be mistake or multiple mistakes somewhere because obviously the answer is not zero.