Let $p>3$ be a prime. We set $R=\{x\in\mathbb{Z}: (x/p)=1\}$, where $(\cdot/p)$ is the Legendre symbol. When $p\equiv3\pmod4$, by class formulae of imaginary quadratic fields $\mathbb{Q}(\sqrt{-p})$, we can easily obtain that $$A_p:=\sum_{0<x<p/2,x\in R}x=(p^2-1)/16,\ \text{if}\ p\equiv7\pmod8,$$ and that $$A_p=\sum_{0<x<p/2,x\in R}x=(p^2-1+8ph(-p))/16,\ \text{if}\ p\equiv3\pmod8,$$ where $h(-p)$ is the class number of $\mathbb{Q}(\sqrt{-p})$. However, in the case $p\equiv1\pmod4$ I can not get the explicit value of $$A_p=\sum_{0<x<p/2,x\in R}x.$$
Your comments are welcome.