## 2 Materials and Methods
### Prime-Searching Algorithm  
Finally, the measurements were submitted to the prime-testing layer, which maps the output distribution of both schemes into a set of random prime numbers with a given bit length \(n_{\text{prime}}\). Since both randomness sources measure Gaussian-distributed phenomena, their output distribution will be biased if no further postprocessing is applied. This could reflect itself on the generation of prime numbers, and thus, their output signals were also mapped into uniform distributions in an effort to increase their measured entropy. With that aim, the measurement distributions were divided by an equiprobable binning algorithm, and 16-bit Gray sequences were attributed to all outcomes falling on a certain bin [29]. Consequently, uniformly distributed 16-bit RNs are obtained. This step is also necessary to do a proper comparative analysis of the two sources since the electronic noise distribution will naturally have a lower variance than the overall homodyne signal, which includes additional contributions. The CS thus occupies a smaller proportion of the ADC range and outputs fewer unique codes, which further increases its bias when compared with the Quantum Source (QS). Nonetheless, to allow an assessment of the impact that this stage has on the statistical quality of the obtained prime RNs, the scenario where the biased distributions were directly used has also been considered. To distill the prime numbers, the 16-bit random output is first converted to its binary representation. The algorithm then gathers a \(n_{\text{prime}}\)-bit prime number candidates by parsing the binary input bitwise until both the Most Significant Bit (MSB) and Least Significant Bit (LSB) are equal to one [34]. This guarantees that the candidate number is odd and has the expected bit-length. Naturally, in a practical application, where the generation rate is a major concern, the MSB and LSB can simply be forced to be unitary while gathering \((n_{\text{prime}}-2)\)-bit binary sequences from the QRNG output. This would greatly increase the fraction of the output submitted to the primality test and thus decrease the number of candidate numbers tested until a prime is found. A sequence of 24 standard Miller-Rabin primality tests is then applied to the candidate number as defined by the Digital Signature Standard [3]. Given that a RE layer was not implemented, the random basis required for each test iteration was obtained from a Mersenne Twister PRNG. This avoids having to further limit the number of candidate numbers submitted and guarantees the statistical significance of the primality test even if correlations exist in the QRNG output. Given the sequence of probabilistic primality tests applied, the expected probability of false positives for this prime generator can be calculated as \(4^{-24}\), thus standing at \(3.55\times 10^{-15}\) For this work, in order to balance between accuracy and algorithmic speed, a compromise was made in selecting this value. Nevertheless, a longer sequence of primality tests should be included to meet the security standards set for cryptographic applications such as RSA key generation [3]. In this work, we have chosen this approach of probabilistic primality testing due to, despite introducing the possibility of false positives, being much faster than deterministic algorithms, thus making the generation of large prime numbers feasible. Disregarding the test algorithmic complexity, a lower bound for the theoretically possible prime generation rate of this scheme, \(N\), can be given by taking the asymptotic approximation for the prime-counting function, \(\pi(x)\approx\frac{x}{\log x}\)[4], yielding:  
\[N(\text{in primes}/\text{s})\approx\frac{G}{2}\frac{n_{\text{prime}}-2}{n_{ \text{prime}}(n_{\text{prime}}-1)\log 2} \tag{4}\]where \(G\) is the maximum throughput of the implementation in bit/s. This yields a reasonable approximation for \(G\gg n_{\text{prime}}\).