arXiv:2611.03484quant-phNov 2026

Manuscript Offprint

arXiv:2611.03484

On the Failure Probability of Quantum Leftover Hashing with Bad Seeds

Asker Friis Bach, Isabel Moreno Babuglia, Jonatan Bohr Brask

Asker Friis Bach,¹,* Isabel Moreno Babuglia,² and Jonatan Bohr Brask²

¹Alea Quantum Technologies and Department of Mathematical Sciences, University of Copenhagen, 2100 København Ø, Denmark

²Center for Macroscopic Quantum States bigQ, Department of Physics, Technical University of Denmark, Fysikvej 307, 2800 Kgs. Lyngby, Denmark (Dated: November 3, 2026)

We study hashing against quantum adversaries, as used in cryptographic applications, and provide bounds on the probability of failure in practical settings where seeds might be reused and might be non-ideal. Randomness extraction and privacy amplification are key components of quantum cryptographic protocols, such as quantum randomness generation or key distribution, that allow the compression of partially secure raw data into shorter output with high security. To ensure the security of any cryptographic construction that integrates them, it is desirable to establish composable security. This can be done by using methods based on universal hashing and leveraging the general leftover hash lemma, which allows extraction of near-uniform random numbers from an imperfect entropy source by sampling from an almost two-universal family of hash functions using a seed. This approach is taken in many practical implementations, commonly using Toeplitz hashing. The lemma provides an upper bound ε\varepsilon on the distance of the output to uniform randomness, which holds on average over the choice of seeds. It makes no claim that any particular seed yields near-uniform random numbers, however. This poses a problem for practical applications where a seed is sampled once and reused for many rounds (blockwise hashing). Here, we study the subset of bad seeds yielding far-from-uniform outputs. We show that randomness extraction against quantum side information is guaranteed to produce δ\delta-close-to-uniform random numbers except with failure probability (εδ)2\left(\frac{\varepsilon}{\delta}\right)^2. This result is generalised to blockwise hashing providing a guarantee of the security of kk rounds except with failure probability ((2k−1)εδ)2\left(\frac{(2k-1)\varepsilon}{\delta}\right)^2. Moreover, we extend the general leftover hash lemma to blockwise hashing and relax the assumption of almost two-universality.

I. INTRODUCTION

Cryptographic systems in general, and in particular quantum cryptographic protocols, often contain multiple components or subroutines that implement more elementary tasks, and these tasks may be common to a variety of different protocols. It is therefore desirable to be able to establish security of composite protocols from the security of their constituent components, i.e. to have a framework of universally composable security [1, 2].

In the context of quantum cryptography, both quantum key distribution (QKD) and quantum randomness generation (QRNG) require post-processing of partially secure strings of data into outputs with quantifiable security guarantees, in processes known as privacy amplification or randomness extraction. Furthermore, this security needs to be established relative to eavesdroppers that may hold quantum side information [3]. Indeed, an adversary that holds a purification of the physical systems or has access to a quantum memory is strictly stronger than a classical adversary [4]. A key approach to establishing composable security against quantum adversaries for randomness extraction is to use constructions based on two-universal hashing [5] and the quantum leftover hash lemma introduced by Tomamichel et al. [6]. One notable example of such a construction is Toeplitz hash-

ing [7, 8], which can be extended to the quantum setting [9] and has found widespread use, e.g. [10–16].

Two-universal hashing requires random selection from a set of hash functions and hence consumes some seed randomness. It is generally desirable to keep the required seeds small and in particular in the context of QRNG, where the goal is generation or expansion of randomness, it is essential that more random bits are extracted than consumed. However, this is not necessarily trivial to achieve. For example, hashing with a Toeplitz matrix requires a seed string that is longer than the output string, effectively consuming more randomness than it generates in a single extraction round. A commonly implemented solution is to leverage that extractors based on two-universal hashing are strong, which implies that the randomness of the seed is (almost) not degraded, and hence reuse one seed for multiple (or even all) extraction rounds, see e.g. [10–14, 16–18]. The leftover hash lemma, however, bounds the quality of the output (its distance from uniform) only on average over the seed choice, not for any specific seed. Reusing the seed therefore introduces a risk that a bad seed degrades security. For this reason, it is interesting to study leftover hashing under seed reuse across rounds (blockwise hashing), and to rigorously quantify the impact of imperfect seeds in this setting. Additionally, it is important to quantify the failure probability of blockwise hashing, i.e., the probability that a seed that produces outputs not close to uniform is sampled.

To these ends, we begin with a brief introduction to

randomness extraction and the leftover hash lemma. The leftover hash lemma allows for the extraction of secure near-uniform randomness from an imperfect source using an almost two-universal family of hash functions. For this work, we consider two versions of the lemma. Firstly, the original version restricted to classical side information, which was proved independently in [19] and [20] with the term leftover hash lemma coined in [21]. Secondly, the more general version presented by Tomamichel et al. [6] considering quantum side information. See also the work by Barak et al. for recent treatment with a classical generalization [22]. Here, we will only provide the necessary details for the presentation of our results, and refer the interested reader to Tomamichel et al. [6] for a comprehensive introduction to randomness extraction against quantum side information.

Before proceeding, we make some remarks on the notation. In this paper, we consider two different notions of side information E. In Section II we consider E to be a classical random variable and in Section III, IV and V we generalise and allow E to be a quantum system entangled with the entropy source. These two scenarios require different notions of conditional min-entropy, distance between random variables and uniform randomness. However, the results obtained are of the same form. Throughout the introduction, we therefore use the same notation in both cases and refer to the subsequent sections for the mathematical formulations against classical and quantum side information.