# References about a boolean function involving hamming weight

Some weeks ago, I read an article about an interesting boolean function with some applications to cryptography. Then, I forgot about the article and now I cannot find it. Hence here I am asking if someone is familiar with this function and can give me some references. Thank you in advance.

Fix a positive integer $$n$$. The function boolean function $$f$$, taking a $$n$$bits words $$\mathbf{x}$$ as input and returning a single bit as output is defined by $$f(\mathbf{x}) = x_{w(\mathbf{x}) \!\!\!\mod\!\! n} ,$$ where $$w(\mathbf{x})$$ is the Hamming weight of $$\mathbf{x}$$ (number of bits equal to 1) and $$\mathbf{x} = x_0 x_1 \dots x_{n-1}$$ (with $$x_i \in \{0,1\}$$).

• isn't the mod n useless in the definition of f? w(x) will always be in {0 ... n-1} anyway. Sep 24, 2020 at 16:01
• @Geoffroy Couteau: the $\mod n$ is necessary to return $x_0$, rather than the undefined $x_n$, when each of the $n$ bits $x_i$ are $1$. An alternative is to define $x_n=1$ and then indeed $f(\mathbf{x})=x_{w(\mathbf{x})}$. Unfortunately that function does not ring any bell. Note: the function is balanced. It tends to return one of it's center bits.
– fgrieu
Sep 24, 2020 at 19:31
• Ah right, missed that, thanks (it does not ring any bell here either). Sep 24, 2020 at 20:11