{'fraction_non_alphanumeric': 0.04211128048780488, 'fraction_numerical': 0.008384146341463415, 'mean_word_length': 4.243756243756244, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Quantum Hashing for Finite Abelian Groups

We propose a generalization of the quantum hashing technique based on the notion of the small-bias sets. These sets have proved useful in different areas of computer science, and here their properties give an optimal construction for succinct quantum presentation of elements of any finite abelian group, which can be used in various computational and cryptographic scenarios. The known quantum fingerprinting schemas turn out to be the special cases of the proposed quantum hashing for the corresponding abelian group.


Introduction
Hashing is a necessary tool in a bag of tricks of every computer scientist. This term is believed to be more than 60 years old and during its long history it has had a variety of useful applications, which include cryptographic protocols, fast search, and data integrity check.
Recently, we have proposed a quantum version of this technique [1], which can also be useful in similar scenarios. For instance, it is a suitable quantum one-way function that can be used in the quantum digital signature protocol by Gottesman and Chuang [2]. It can also be used in different quantum computational models as a basis for efficient algorithms [3] and communication protocols [4].
The classical hashing is deeply connected with error-correcting codes, i.e. as shown by Stinson [5] they can be built from each other. The special case of error-correcting codes called ε-balanced codes is related to another important combinatorial object known as ε-biased sets [6], which have applications in different areas of theoretical computer science, such as derandomization, graph theory, number theory, etc. There are several known explicit constructions of ε-balanced error-correcting codes [6], [7], [8] that give rise to corresponding ε-biased sets.
In this paper we show that ε-biased sets can be used to construct quantum hash functions that have all the necessary cryptographic properties.

Preliminaries
The construction of quantum hashing in this paper relies on the notion of the ε-biased sets. We use the definition given in [9].
Let G be a finite abelian group and let χ a be the characters of G, indexed by a ∈ G.
It follows from the Alon-Roichman theorem [10] that a set S of O(log |G|/ε 2 ) elements selected uniformly at random from G is ε-biased with high probability. The paper [9] gives explicit constructions of such sets thus derandomizing the Alon-Roichman theorem.

Quantum Hashing
Let G be a finite abelian group with characters χ a , indexed by a ∈ G. Let S ⊆ G be an ε-biased set for some ε ∈ (0, 1).

Definition 3.1
We define a quantum hash function ψ S : G → (H 2 ) ⊗ log |S| as following: The above function given an element a ∈ G creates its quantum hash, which is a quantum state of log |S| qubits. As mentioned earlier S can be of order O(log |G|/ε 2 ), and thus quantum hashing transforms its inputs into exponentially smaller outputs. That is, for any a ∈ G represented by log |G| bits the number of qubits in its quantum hash would be log S = O(log log |G| − log ε).
The cryptographic properties of the hashing from Definition 3.1 are entirely determined by the ε-biased set S ⊆ G.
In particular all pairwise inner products of different hash codes (which is also the measure of collision resistance [1]) are bounded by ε by the following Lemma.
Proof. Let χ a1 (x), χ a2 (x) be two different characters of G. Then χ * a1 (x) is also a character of G, and so is the following function Thus, Lemma follows from the definition of an ε-biased set Irreversibility of ψ S is proved via the Holevo theorem and the fact that a quantum hash is exponentially smaller than its preimage.
The size of the quantum hash above is asymptotically optimal because of the known lower bound by Buhrman et al. [11] for the size of the sets of pairwisedistinguishable states: to construct a set of 2 k quantum states with pairwise inner products below ε one will need at least Ω(log(k/ε)) qubits. This implies the lower bound on the size of quantum hash of Ω(log log |G| − log ε).
In the next sections we give a more detailed look on the quantum hashing for specific finite abelian groups. In particular, we are interested in hashing binary strings and thus it is natural to consider G = Z n 2 and G = Z 2 n (or, more generally, any cyclic group Z q ).

Hashing the Elements of the Boolean Cube
For G = Z n 2 its characters can be written in the form χ a (x) = (−1) (a,x) , and quantum hash function is the following The resulting hash function is exactly the quantum fingerprinting by Buhrman et al. [11], once we consider an error-correcting code, whose matrix is built from the elements of S. Indeed, as stated in [8] an ε-balanced error-correcting code can be constructed out of an ε-biased set. Thus, the inner product (a, x) in the exponent is equivalent to the corresponding bit of the codeword, and altogether this gives the quantum fingerprinting function, that stores information in the phase of quantum states [12].

Hashing the Elements of the Cyclic Group
For G = Z q χ a (x) = e 2πiax q , and quantum hash function is given by |ψ S (a) = 1 |S| x∈S e 2πiax q |x .
The above quantum hash function is essentially equivalent to the one we have defined earlier in [1].