# How to map the points of an elliptic curve cyclic group to $\mathbb{Z}_q$ using a hash function?

Let $E$ be an elliptic curve defined over $\mathrm{GF}(q)$, where $q=p^r$. Let $G$ be a cyclic group of points of $E$. Then how we can map points of $G$ into $\mathbb{Z}_q$ using a hash function.

• – Changyu Dong Jun 26 '18 at 13:02
• Also see this older Q&A and note that "whatever the standard you are following says" when applicable. – SEJPM Jun 26 '18 at 13:44
• @SEJPM I have read the answer that you suggested me to read – syed burhan Jun 27 '18 at 6:27
• @SEJPM Why are we using key derivation function in it ? I know nothing about it and have not used before...What I got from that answer is first, we have to apply a hash function e.g sha 512 and then we have to convert the output into an integer and take a mod on it to reduce the answer...Am I right or not ? – syed burhan Jun 27 '18 at 6:30
• I think you are mostly right, but you might want to add two things. You should hash some canonical representation of the point, if you want to make sure that the same points hashes to the same element. Secondly, you might want to use around 128 bits longer of a hash output, before applying modulus (cfr. eg. NIST SP 800-185 Appendix B) to make the output more evenly distributed. – Ruben De Smet Jun 27 '18 at 9:06