0

I have an arbitrary string. I want to know how to implement a hash function $H: \{0,1\}^* \to \mathbb F_q^n$ which takes arbitrary strings to an element of $\mathbb{F}_q^n$. Here $\mathbb{F}_q$ denotes the finite field of order $q$.

Edit: $q=256$

Edit 2: $\mathbb F_q^n$ simply means $n$ dimensional vector space over $\mathbb{F}_q$. If $x \in \mathbb F_q^n$, it means $x$ has the following form

$$x=(x_1,x_2,\ldots,x_n), \mbox{ with } x_i \in \mathbb{F}_q$$

Shweta Aggrawal
  • 309
  • 1
  • 6
  • Relevant: https://crypto.stackexchange.com/questions/88002/how-to-map-output-of-hash-algorithm-to-a-finite-field – meshcollider Feb 06 '22 at 09:31
  • It is not clear about $q=?$. Another one https://crypto.stackexchange.com/q/87012/18298 and another https://crypto.stackexchange.com/q/86375/18298 – kelalaka Feb 06 '22 at 10:47
  • [Revised for Edit2] Hint: What is $\mathbb F_q$? How many elements are there in $\mathbb F_q$? Thus in ${\mathbb F_q}^n$? How do you write $\mathbb F_q$ as $\mathbb F_{p^k}$? Thus how many bits do you need to represent an element of $\mathbb F_q$? Of ${\mathbb F_q}^n$? How do you get these bits with a hash of the SHA family? – fgrieu Feb 06 '22 at 18:02
  • @fgrieu Thank you for your hints. I will think about it and let you know as soon as possible. Thanks again for showing the right direction. – Shweta Aggrawal Feb 07 '22 at 07:34

0 Answers0