# Reference for a formula of Kloosterman sum (in connection with Jacobi symbol) and its generalizations

The following is from wikipedia:

The lifting formulas below, however, are often as good as an explicit evaluation. If $gcd(a,p) = 1$ one also has the important transformation: $$S(a,a;p) = \sum_{m=0}^{p-1} \left(\frac{m^2-4a^2}{p}\right) e^{\frac{2\pi i m}{p}},$$ where $\left(\tfrac{\ell}{m}\right)$ denotes the Jacobi symbol.

I am looking for the reference of this formula.

I am also looking for similar formulas for other Kloosterman sums ( higher dimensions).

• This one's easy enough to reconstruct an argument without a reference: For how many $x$ is $m = ax + ax^{-1}$? This gives a quadratic equation with discriminant $m^2-4a^2$, etc. – Noam D. Elkies Mar 11 '17 at 2:33