I am reading a paper on elliptic curve cryptography. In the paper (Section 4), the authors claim that when the characteristic of the field is represented as $$p=a^2+|D|b^2\\ \\ or\\ p=\frac{|D|+1}{4}a^2+|D|ab+|D|b^2,$$
then the trace of the Frobenius morphism can be written as $$T=\pm 2a\\ \\ or\\ T=\pm a$$ respectively. I have tried in vain to prove this claim. Could anyone suggest a reference or a strategy to prove this result?