domain: math info

text:
David Lubicz

Viktor Fischer

Entropy Computation for Oscillator-based Physical Random Number Generators

Keywords: Hardware random number generators, free-running oscillators, stochastic models, entropy, dedicated statistical tests

In this paper, we provide a complete set of algorithms aimed at the design and security evaluation of oscillator-based True Random Number Generators (TRNG). While depending on some TRNG design assumptions, the proposed algorithms use as inputs the statistical parameters of the underlying random physical process such as the clock jitter originating from the thermal noise and give a lower bound of the entropy rate of the generated bit stream as output. We describe the general structure of a TRNG composed of multiple free-running oscillators and samplers, the outputs of which are post-processed by an entropy conditioner. Depending on the specification of the entropy conditioner, which can usually be any Boolean function, we describe several algorithmic optimizations. We then explain how to compute and efficiently manage the entropy rate at the output of such a post-processing block and at the output of the generator as a whole.

Introduction

Random numbers play a crucial role in modern cryptography as confidential keys, initialization vectors, padding values, nonces, and also as random masks in side-channel attack countermeasures. A recent implementation of a random number generator targeting cryptography applications is composed of two stages: a non deterministic stage, called True Random Number Generator (TRNG) and a deterministic stage, called Deterministic Random Number Generator (DRNG).

The TRNG serves as an entropy source -it should guarantee unpredictability of generated numbers even for an attacker with an unlimited computational power. The DRNG, which uses TRNG output as a seed, guarantees the output of the random number generator is unpredictable for an attacker with limited computational power even if the TRNG partially or temporarily fails. DRNGs should be designed as cryptographic modes with a model of security (see [START_REF] Barak | An architecture for robust pseudo-random generation with applications to /dev/random[END_REF]) and associated proof by reducing the difficulty involved in breaking an underlying cryptographic primitive (for instance, the AES cipher).

This paper deals with a general problem in designing a TRNG for cryptographyentropy extraction from several low entropy sources and entropy management in the resulting combined bit stream. Designing a TRNG with a proven security level that can be easily implemented in logic devices is still a challenge. The security level reached is assessed by the entropy rate per output bit or vector of bits. For practical reasons, Shannon entropy [START_REF] Shannon | A Mathematical Theory of Communication[END_REF] is usually used.

To rigorously estimate the entropy rate, it is necessary to go through a general TRNG design process in several steps, some of which may be difficult to master and may also be limited by constraints determined by the available technology. The designer should proceed in the following steps:

1. Identify the physical process that causes the random behavior of the generator. The causes of such a behavior in electronic equipment including logic devices are essentially random analog electric noises: a random noise is by definition an unpredictable phenomenon that cannot be manipulated by an attacker. Unfortunately, analog noises are not directly exploitable in logic devices. Consequently, designers have to find a way of converting the contribution of random analog noises into random behavior in the digital domain. This may be a process that converts analog noises into the clock jitter in the free-running oscillators and self-timed rings [START_REF] Sunar | A Provably Secure True Random Number Generator with Built-In Tolerance to Active Attacks[END_REF][START_REF] Cherkaoui | A Very High Speed True Random Number Generator with Entropy Assessment[END_REF], or into an uncertainty of the resumed state after a metastability event in metastable flip-flops [START_REF] Vasyltsov | Fast Digital TRNG Based on Metastable Ring Oscillator[END_REF], or into a number of oscillations caused by the oscillatory metastability [START_REF] Varchola | New High Entropy Element for FPGA Based True Random Number Generators[END_REF], or to the selection of the final state after write collisions in dual-port RAMs [START_REF] Guneysu | True Random Number Generation in Block Memories of Reconfigurable Devices[END_REF] or after a startup of a bi-stable circuit or memory element [START_REF] Taylor | Behind Intel's New Random-Number Generator[END_REF].

2. Build a stochastic model (or select an existing one) of the exploited random physical process, i.e. of a source of randomness. The stochastic model of the random physical process gives the (statistical) law of evolution of its state in time, depending on certain input physical parameters.

3. Design a TRNG that converts the output of the random physical process into a stream of bits or bit vectors and build a statistical model of the whole TRNG. The stochastic model of the TRNG gives a distribution of probability of bits or vectors of bits depending on the input noise, the way it is converted into the digital domain, and the way the entropy is extracted from the physical process, depending on the input parameters of the physical process. Some input parameters of the TRNG are adjustable by design, e.g. the sampling period or accumulation time in oscillator based TRNGs, whereas some depend only on the technology, e.g. jitter originated from thermal or flicker noise.

4. Design a method (or select an existing one) to measure the input parameters of the stochastic model built in Step 2 and/or the model built in Step 3. The measurement can be taken inside or outside the device. Embedded measurement methods like those presented in [START_REF] Fischer | Embedded Evaluation of Randomness in Oscillator Based Elementary TRNG[END_REF][START_REF] Fischer | Modern random number generator design -Case study on a secured PLL-based TRNG[END_REF] for TRNGs using clock generators are preferable, since they do not include contribution of external noise sources.

5. Compute the entropy rate at the TRNG output and adjust the TRNG design parameters. The TRNG design space is explored by using the model and its input parameters to obtain the desired entropy rate in a process called entropy management.

If any of the above steps in the TRNG design are omitted, the generator should not or even must not be used in high-security cryptographic applications, but only a very limited number of papers in which all these steps are addressed, have been published up to now. We cite for instance a free-running oscillator based TRNG [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF][START_REF] Fischer | Embedded Evaluation of Randomness in Oscillator Based Elementary TRNG[END_REF] or a phase-locked loop (PLL) based TRNG [START_REF] Fischer | Modern random number generator design -Case study on a secured PLL-based TRNG[END_REF].

Building a stochastic model is not straightforward, since it requires a high level of expertise in both physics (electronics) and mathematics (statistics). Note that in the above mentioned TRNG design workflow, three levels of models could (and preferably should) exist:

• Model of the origin of random behavior -obviously the model of the random electric noise(s);

• Model of the random physical process including the underlying model of the electric noise(s) and of its conversion to the digital domain, i.e. a kind of an analog-todigital conversion;

• Model of the TRNG including the model of the random physical process and the entropy extraction method (sampling of random signals, counting of random events, etc.).

Many different TRNG designs have been published in the last few years, but only a few include a statistical model. Some existing models are used to model dependence of the clock period of free-running oscillators (or clock generators in general) on random noises and especially on thermal noise [START_REF] Cherkaoui | A Very High Speed True Random Number Generator with Entropy Assessment[END_REF][START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF][START_REF] Bernard | Mathematical Model of Physical RNGs Based on Coherent Sampling[END_REF], others estimate entropy using a simple urn model [START_REF] Sunar | A Provably Secure True Random Number Generator with Built-In Tolerance to Active Attacks[END_REF] or a general model based on sampling of a noisy signal [START_REF] Killmann | A Design for a Physical RNG with Robust Entropy Estimators[END_REF].

But even in the case of oscillator based TRNG, which is arguably one of the simplest and best understood TRNG principles, a complete solution for the last step of the aforementioned TRNG design workflow has not yet been published. By a complete solution, we mean a description of a generic algorithmic suite that is efficient and easily adaptable to TRNGs using differences in clock phases as a source of randomness and that can be used to compute and guarantee a precise lower bound of the entropy rate.

For instance, in practice, the formula [3, Corollary 1] cannot be used to compute the entropy rate in most implementations of the oscillator based TRNG. The first problem is that the formula is based on the assumption that the duty cycle is equal to 0.5, which is almost never the case in standard implementations. Certainly, one can easily tweak the formula [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF]Corollary 1] in order to take a biased duty cycle into account. But a more serious concern is that this equation originates from a truncated Fourier series and as such, is an approximation that is only valid if the quality factor is sufficiently high (for a definition of the quality factor in this context see [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF]Section 2.4]). For quality factors in the range of those used in practical applications, in Section 7, we show that the results of [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF] do not apply.

Moreover, an oscillator-based TRNG is usually a complex structure composed of several free-running oscillators (e.g. ring oscillators) and samplers, whose outputs are somehow combined and post-processed using an entropy extraction algorithm. It is clear that this complex entropy extraction process has to be taken into account when estimating entropy rate.

The authors of [START_REF] Wu | On the Security of TRNGs Based on Multiple Ring Oscillators[END_REF] deal with the case when the entropy conditioner is an exclusive or (XOR) function. Their computations of a lower bound of the entropy rate of the TRNG are based on the results of [3, Corollary 1] and rely on the assumption that each time the TRNG produces a bit, its internal state (or to be more precise, its phase) is known by the attacker. This hypothesis, although very convenient for entropy computation, is not realistic, because the only knowledge the attacker gets from the TRNG when it outputs a bit, is the bit itself.

We will see that knowledge of the internal state, although not really discussed in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF][START_REF] Wu | On the Security of TRNGs Based on Multiple Ring Oscillators[END_REF], leads to significant underestimation of the entropy rate of the TRNG. To assess the lower bound of the TRNG output entropy rate more precisely, we consider a more realistic security assumption, in which the attacker only knows the most recent output bits of the TRNG. Our solution is also more general since it can be used to model the operation of the entropy conditioner based on any Boolean function.

In this paper, we provide all the algorithms needed to compute a lower bound of the entropy rate produced by the thermal noise in a TRNG, in which multiple oscillators generate jittered clocks. These algorithms can easily be adapted to a wide range of designs of of TRNGs using differences in clock phases as a source of randomness. We can consider various versions of elementary oscillator-based TRNG (EO-TRNG) [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF], multiple oscillator-based TRNG (MURO-TRNG) [START_REF] Sunar | A Provably Secure True Random Number Generator with Built-In Tolerance to Active Attacks[END_REF][START_REF] Wu | On the Security of TRNGs Based on Multiple Ring Oscillators[END_REF], TRNG using self-timed rings (STR-TRNG) [START_REF] Cherkaoui | A Very High Speed True Random Number Generator with Entropy Assessment[END_REF] or even coherent sampling oscillator-based TRNG (COSO-TRNG) [START_REF] Bernard | Mathematical Model of Physical RNGs Based on Coherent Sampling[END_REF] as suitable candidates, since in all these generators, a jittered clock signal is sampled on the edges of a reference clock signal. Note that the proposed algorithms are not suitable for evaluation of the transition effect ring oscillator-based TRNG (TERO-TRNG) [START_REF] Varchola | New High Entropy Element for FPGA Based True Random Number Generators[END_REF], in which the randomness does not originate from differences in clock phases, but from the timing of collisions of two events circulating in the ring. Furthermore, we discuss the complexity of the algorithms and potential difficulties with their application. All the algorithms have been implemented in Python and are freely available on a public server.

The paper is organized as follows: In Section 2, we describe the general scheme of oscillator based TRNGs we consider in the paper: Elementary Oscillator-based TRNG (EO-TRNG) and Multi-oscillator-based TRNG (MO-TRNG). In Section 3, we provide an overview of the entropy estimation algorithms and explain the main design choices we made. In Section 4, we explain how to model EO-TRNGs using a Markov chain, and in Section 5, we clarify how to model MO-TRNGs including digitization and postprocessing. In Section 6, we validate the models in simulations and illustrate the results using two security models: model A and B. In Section 7, we validate the new entropy estimation method in hardware experiments, discuss results we obtained and explain how the proposed algorithms can be used to manage the entropy rate at the MO-TRNG output. In Section 8, we conclude the paper and consider possible avenues for further study.

General scheme of oscillator-based TRNGs

In this section, we first describe the general structure of the simplest oscillator-based TRNG -Elementary Oscillator-based TRNG (EO-TRNG). This will help determine notations and specify inputs and outputs of the algorithms. We then generalize the same approach to construct what we call Multi-oscillator-based TRNG (MO-TRNG), variants of which can be found in the scientific literature. Indeed, our generalized theory can be adapted to many TRNG designs based on free-running oscillators, in which jittered clock signals are sampled on the edges of the reference clock signal.

A free-running oscillator, such as a ring oscillator or self-timed ring, produces a clock signal, the phase of which tends to drift because of the instability of the propagation time of electric signals across logic gates, termed phase jitter. The output signal s(t) of a free-running oscillator O can be modeled by a periodic function of time t having the form:

s(t) = f α (ω(t + ξ(t))), (1)
where f α is a given real valued 1-periodic function [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF] such that f α (x) = 1 for 0 < x < α, f α (x) = 0 for α < x < 1, and f α (0) = f α (α) = 1/2. Here α is the duty cycle of the sampled oscillator. The term ϕ(t) = ω(t + ξ(t)) is the total phase of the oscillator where ω is its mean frequency and ξ accounts for the phase jitter.

The phase jitter ξ has different components, some are deterministic, e.g. periodic jitter or data dependent jitter, and others are non-deterministic. Only the non-deterministic (i.e. random) component of the phase jitter contributes to the output entropy of the TRNG. The non-deterministic component of the phase jitter may be a consequence of various physical phenomena, each of which may have different statistical properties, for instance, thermal noise, shot noise or flicker noise.

Thermal noise is the most frequently exploited noise in TRNGs, since it has been characterized, is well understood and modeled. Since thermal noise is statistically independent of other kinds of noises, its contribution to the entropy rate of a TRNG is added to contributions from other physical phenomena. As a consequence, only accounting for the contribution of thermal noise to the phase jitter is sufficient to determine a lower bound of the entropy rate at the TRNG output and to guarantee the security of the generator. In the following, we thus only consider the thermal noise component of the phase jitter.

Exactly like in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF], we (citation) "model the evolution of the total phase ϕ(t) = ω(t + ξ(t)) from Eq. (1), i.e. the phase of a ring oscillator depending on the thermal noise, as a Wiener stochastic process Φ(t) with drift µ > 0 and volatility σ 2 > 0. In other words, for any time t ≥ t 0 , the phase Φ(t) conditioned by the value Φ(t 0 ) = ϕ(t 0 ) follows a Gaussian distribution of mean ϕ(t 0 ) + µ(t -t 0 ) and variance σ 2 (t -t 0 )". Equivalently, in terms of conditional probability density, we have for all t > t 0 , x, x 0 ,

O 1 O 0 % D D Q clk Sampler (D Flip-flop)
d dx P{Φ(t) ≤ x | Φ(t 0 ) = x 0 } = 1 σ 2π(t -t 0 ) exp -(x -x 0 -µ(t -t 0 )) 2 2σ 2 (t -t 0 ) . (2)
Comparing the definition of µ with Eq. ( 1), we can see that µ = ω. Consequently, the parameters needed to model the probabilistic evolution of the phase jitter component caused by the thermal noise in oscillator O i are:

• α i -the duty cycle of the clock signal generated by the oscillator;

• T i -its mean period;

• σ 2 i -the volatility of the associated Wiener process. In the following, we call the triplet (α i , T i , σ 2 i ), the statistical parameters of oscillator O i . Once we have presented the background of a free-running oscillator, we introduce a RNG that exploits the phase jitter to produce random bits -an oscillator-based TRNG. In the simplest version of this kind of generator, which we call Elementary Oscillatorbased TRNG (EO-TRNG) according to [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF], the output of a free-running oscillator is sampled by a sampling operator at the time intervals defined by the reference clock. The sampling operator may be a synchronous D flip-flop, an asynchronous D-latch, or some more advanced structure like a synchronous or asynchronous counter.

The reference clock signal that determines the sampling periods can be produced by another free-running oscillator or by a quartz oscillator. However, note that the use of a free-running oscillator is preferable, because the use of two identical free-running oscillators (which generate both sampled and sampling clocks) significantly reduces the impact of global noises which can be manipulated. The frequency of the reference clock signal is divided by D. The value of D determines the jitter accumulation time and hence the entropy rate at the TRNG output (see [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF]): if D increases, the output bit rate of the EO-TRNG decreases, but the entropy per bit increases and converges to one. Figure 1 represents a typical EO-TRNG that we consider in this paper: the sampling operator is a D flip-flop and the sampled clock signal and reference clock signal are produced by two ring oscillators.

In [3, Appendix C], the output of oscillator O 1 with statistical parameters (α 1 , T 1 , σ 2 1 ), sampled at time intervals determined by oscillator O 0 featuring statistical parameters (α 0 , T 0 , σ 2 0 ), is shown to produce the same distribution of output bits as a stable clock signal (a jitter-free signal) with duty cycle 0.5 and period T 0 sampling an oscillator O 1 with statistical parameters (α 1 , T 1 , σ ′ 2 1 ) where

σ ′ 2 1 = T 0 T 1 2 σ 2 0 + σ 2 1 . (3)
We have selected 0.5 arbitrarily for the duty cycle of the sampling signal as it does not alter the distribution of the output bits, since only the rising edge of O 0 affects the output of the D-flip-flop. Taking the above mentioned facts into account, we assume in the following that in an EO-TRNG, the sampled oscillator is the only oscillator subject to the phase jitter and that the sampling oscillator outputs a jitter-free clock signal.

We fix this setting in order to clarify the presentation, but it should be noted that all the TRNG variants we have mentioned up to now and possibly others can be taken into account in our algorithms with only minor modifications.

The sampling oscillator O 0 produces a stable clock signal, which is thus described by its triplet (0.5, T 0 , 0). On the other hand, the statistical parameters of the sampled oscillator

O 1 are (α 1 , T 1 , σ ′ 2 1 )
. By scaling the time by T 1 , the parameters of the sampling oscillator (resp. the sampled oscillator) become (0.5,

T 0 /T 1 , 0) (resp. (α 1 , 1, (σ ′ 1 /T 1 ) 2 )).
In fine, we see that the statistical properties of an EO-TRNG depend on three parameters.

Definition 1. The statistical parameters of an EO-TRNG are:

• α = α 1 -the duty cycle of the sampled clock signal;

• µ = T 0 /T 1 -the drift of the Wiener process described in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF];

• σ 2 = (σ ′ 1 /T 1 )
2 -the volatility of the Wiener process described in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF].

Note that in the preceding definition, knowing that the sampled signal is 1-periodic and assuming that the distribution of the output bits of the EO-TRNG remains unchanged, we can replace µ by

µ ′ = T 0 /T 1 mod 1 if µ ′ ̸ = 0, otherwise µ ′ = 1, and replace σ 2 by σ ′ 2 = σ 2 µ µ ′ .
In other words, if the volatility does not change then µ ∈]0, 1]. The bit rate of a single EO-TRNG featuring a sufficient entropy rate is usually not high enough for practical applications. Moreover, it is preferable to have some security margin in the entropy rate obtained at the TRNG output, in order to account for possible flaws, aging and malfunctions. This is why an oscillator based TRNG is generally made of several EO-TRNGs working in parallel, the outputs of which are processed together by an entropy conditioning algorithm -a deterministic algorithm that combines (typically via a modulo 2 operation) several (non-deterministic) inputs, and outputs a high entropy bit stream.

Figure 2 shows the general scheme of a multi-oscillator-based TRNG (MO-TRNG) we consider in this paper. It is composed of ℓ elementary oscillators-based TRNGs, EO-TRNG i for i = 1, . . . , ℓ with statistical parameters (α i , µ i , σ 2 i ) that share the same reference clock generator (oscillator O 0 ). The outputs of EO-TRNG i are gathered in an entropy conditioner given by a function ζ ℓ (x 1 , . . . , x ℓ ) of oscillators' output bits.

We denote by (α i , µ i , σ 2 i ) for i = 0, . . . , ℓ the respective statistical parameters of O 0 (the sampling oscillator) and O i for i = 1, . . . , ℓ (the sampled oscillator(s)). We have to take care of the fact that, as EO-TRNG i share the same clock signal, we can not use Eq. ( 3) to compute σ ′ 2 i , i = 1, . . . , ℓ for all sampled clocks. Instead, to avoid entropy overestimation, we should consider that the MO-TRNG is made of EO-TRNG i , the phase jitter of which only comes from the sampled oscillator and thus take σ ′ i = σ i (simple conservative approach). Alternatively, it is also possible to take into account the entropy coming from the sampling oscillator O 0 by taking σ ′ 2 1 = (T 0 /T 1 ) 2 σ 2 0 + σ 2 1 just for one couple of rings and use σ ′ 2 i = σ 2 i for i ≥ 2 (more precise solution).

Remark 1. It would also have been possible to consider a MO-TRNG made of several EO-TRNGs each with their own clock reference. The drawback to such a design is that it might cause significant synchronization problems at the level of the entropy conditioner.

It is nonetheless possible to simulate such a design with the techniques that we describe in the present paper.

In this paper, we describe an efficient algorithm that takes (α i , µ i , σ 2 i ) as inputs and outputs the entropy rate per bit of the TRNG using the entropy conditioning function ζ ℓ , while accounting for the thermal noise component of the phase jitter. As explained above, this entropy rate per bit guarantees the security of the TRNG aimed at cryptographic applications. We explain how to compute the Shannon entropy rate since it is one of important evaluation criteria in widely used evaluation methodology [START_REF] Schindler | Evaluation Criteria for True (Physical) Random Number Generators Used in Cryptographic Applications[END_REF]. However, since our method is more general, it can be used to compute the full spectrum of Rényi entropies.

From Markov chains to the new security model

In [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF], it is shown that the output bits of an oscillator-based TRNG are not independent so that its modeling by a non-trivial Markov chain is essential in the evaluation of entropy rate. In this section, we develop algorithms using Markov chains for that purpose. First, we recall the definition of a Markov chain, which is slightly adapted to our needs: Definition 2. Let bits be an alphabet (most of the time in the following bits = {0, 1}), k a positive integer and S k the set of finite sequences of length k with value in bits. We denote by R(S k ) the set of random variables with value in S k . Let P(S k ) be the set of subsets of S k . We define the map succ :

S k → P(S k ), s = b 1 . . . b k → {b 2 . . . b k b|b ∈ bits}.
For m as a positive integer, a Markov chain X with memory m ≥ 1 is a sequence (X i ) i≥0 of elements of R(S m ), where S m is the set of states, such that for all n, k positive integers, n ≥ k: Moreover, we assume that if

1. P(X n = x n |X n-1 = x n-1 , . . . X n-k = x n-k ) = P(X n = x n |X n-1 = x n-1 ), 2. P(X n = x n |X n-1 = x n-1 ) does not depend on n. 8 O l O 0 % D D Q clk D Q clk D Q clk O 2 O 1 . . . . . .

Entropy conditioner

x n / ∈ succ(x n-1 ) then P(X n = x n |X n-1 = x n-1 ) = 0. The matrix T (X) = (t x,y ) such that t x,y = P(X n = x|X n-1 = y) for x, y ∈ S m is called the transition matrix of X.
We denote by M(m, bits) the set of Markov chains with memory m, over the alphabet bits.

It is clear that succ maps any element s ∈ S m to the set of its possible successors. If s ′ = b 1 . . . b m ∈ succ(s) then the transition from state s to s ′ is labeled by s m ∈ bits. Definition 3. We denote by T (m) the set of matrices T = (t x,y ) x,y∈Sm such that t x,y ∈ [0, 1] for all x, y ∈ S m , t x,y = 0 if x / ∈ succ(y) and y∈Sm t x,y = 1.

Note that a transition matrix of a Markov chain is in T (m). From our knowledge of a current state distribution X i ∈ R(S m ) and transition matrix T (X), we can compute the next state distribution X i+1 ∈ R(S m ) with:

P(X i = b 1 . . . b m ) = b∈bits t b1...bm,b b1...bm-1 P(X i-1 = b b 1 . . . b m-1 ), (4)
so that we can inductively recover (X i ) i>0 from X 0 . This motivates the following definition.

Lemma 1. A Markov chain X = (X i ) i≥0 is defined by the transition matrix T (X) = (t x,y ) ∈ T (m) and initial state X 0 in R(S m ). We denote such a Markov chain by X(X 0 , T (X)).

The representation of a Markov chain by a pair (X 0 , T (X)) is not efficient in terms of time and space since most of the coefficients t x,y are 0. To obtain a representation that is better adapted to computations, note that from X 0 ∈ R(S m ) and T (X) ∈ T (m), we can define inductively random variables, that we denote by X0 (k) ∈ R(S k ) for all k > m ≥ 1 by:

P( X0 (k) = b 1 . . . b k ) = P(X n = b k-m+1 . . . b k |X n-1 = b k-m . . . b k-1 )P( X0 (k -1) = b 1 . . . b k-1 ). ( 5
)
Note that X0 (m + 1) makes it possible to recover X0 (m) using:

P( X0 (m) = b 1 . . . b m ) = b∈bits P( X0 (m + 1) = b 1 . . . b m b). (6)
But this means that X0 (m + 1) makes it possible to recover the transition matrix t x,y for x ∈ succ(y) using Eq. ( 5) with k = m + 1. Precisely, for x = b 1 . . . b m and y = b 0 . . . b m-1 in S m , we have:

t x,y = P( X0 (m + 1) = b 0 . . . b m ) P( X0 (m) = b 0 . . . b m-1 ) . ( 7
)
We have the following lemma:

Lemma 2. The map β : R(S m+1 ) → M(m, bits), R(m + 1) → X(X 0 , T (X)) where X 0 and T (X) are obtained from R(m + 1) respectively by Eq. ( 6) and ( 7), is bijective.

Proof. It is enough to prove that the map β 0 : R(S m+1 ) → R(S m ) × T (m) defined by Eq. ( 6) and ( 7) is bijective. Let us denote by γ : R(S m ) × T (X) → R(S m+1 ) defined in [START_REF] Bernard | Mathematical Model of Physical RNGs Based on Coherent Sampling[END_REF]. It is clear that µ is an inverse of β 0 and we are done.

Definition 4. The random variable X0 (m + 1) ∈ R(S m+1 ) representing X(X 0 , T (X)) can be encoded by a function:

f X(X0,T (X)) : S m+1 → R, b 1 . . . b m+1 → P( X0 (m + 1) = b 1 . . . b m+1 ). (8)
We say that f X(X0,T (X)) is the encoding function of X(X 0 , T (X)).

This way of encoding any Markov chain in M(m, bits) takes O(log 2 (|bits| m+1 )) memory bits and it is consequently optimal. Let X = (X i ) i≥0 ∈ M(m, bits) and suppose that X = X(X 0 , T (X)) for X 0 ∈ R(S m ) and T (X) ∈ T (m). From the pair (X 0 , T (X)), one can inductively compute (X j , T (X)) using Eq. ( 4). Algorithm 1 does the same thing with the encoding function f X(Xj ,T (X)) . Definition 5. An element X k0 of the Markov chain

(X i ) i≥0 is stable, if for all k ≥ k 0 condition X k+1 = X k is fulfilled.
A Markov chain (X i ) i≥0 with memory m verifies the ergodicity and irreducibility conditions, so that according to [START_REF] Ash | Information Theory[END_REF], it has a unique stable element, towards which it converges starting from any X 0 . We denote this stable element in R(S m ) by X ∞ . We have: lim

i→∞ X i = X ∞ . (9)
Algorithm 1: Algorithm to compute (X j+1 , T (X)) from (X j , T (X)).

notation: Let X = (X 0 , T (X)) be the Markov chain with initial state X 0 and transition matrix T (X). We use the notations:

• for s= b 1 . . . b m ∈ S m and k = j, j + 1 prob state(k, b 1 . . . b m ) = b∈bits f X(X k ,T (X) (b 1 . . . b m + b)
where + is the concatenation (see formula ( 6)) ;

• for s= b 1 . . . b m ∈ S m , b ∈ bits: prob trans(b 1 . . . b m , b) = f X(Xj ,T (X)) (b 1 . . . b m + b)/prob state(j, b 1 . . . b m ),
(see formula [START_REF] Dichtl | Bad and Good Ways of Post-processing Biased Physical Random Numbers[END_REF]).

input

: f X(Xj ,T (X)) the encoding function of X(X j , T (X)) the Markov chain with initial state X j and transition matrix T (X). output : f X(Xj+1,T (X)) the same notation as before, but with j + 1.

for s ∈ S m do Write s = b 1 . . . b m , b i ∈ bits; ps0 ← ′ 0 ′ + b 1 . . . b m-1 ; ps1 ← ′ 1 ′ + b 1 . . . b m
s at time j + 1 */ f X(Xj+1,T (X)) (s + ′ 0 ′ ) ← p next * prob trans(b 1 . . . b m , 0); f X(Xj+1,T (X)) (s + ′ 1 ′ ) ← p next * prob trans(b 1 . . . b m , 1); end return f X(Xj+1,T (X)) ;
Algorithm 2: Algorithm to compute the stable state of a Markov chain X = (X i ) i≥0 . input :

• f X(X0,T (X)) the encoding function of X = X(X 0 , T (X));

• ϵ > 0 the precision of the computation.

output: f X(X∞,T (X)) the encoding function of X(X ∞ , T (X)) where

X ∞ ∈ R(S m ) is the stable element of X. 1 k ← j; 2 repeat 3 Call Algorithm 1 to compute f X(X k+1 ,T (X)) from f X(X k ,T (X)) ; 4 until ∀s ∈ S m+1 , |f X(X k+1 ,T (X)) (s) -f X(X k ,T (X)) (s)| < ϵ; 5 return f X(X k+1 ,T (X)) ;
Algorithm 2 uses this last limit to compute an approximation of the stable element. In practice, the convergence is rapid: to obtain a precision of 10 -3 , less than 100 iterations are usually required.

The link between the Markov chain and the Shannon entropy as a measure of security of the TRNG we want to compute is given by Definition 6.

Definition 6 ([1]

). The Shannon entropy of a memory m Markov chain X = (X i ) i≥0 , with stable element X ∞ and transition matrix T = (t x,y ) can be computed as:

E m (X) = x∈Sm y∈Sm P( X∞ (m) = y)(-t x,y log 2 t x,y ) (10)
From the definition, we immediately deduce Algorithm 3 to compute the Shannon entropy of a Markov chain. Note that our definition of the Shannon entropy depends on parameter m. This is because we approximated the statistical behavior of the TRNG using an information source with memory m. When m tends to infinity, under general assumptions on the TRNG, which are fulfilled according to [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF], this source of information converges towards a perfect statistical model of the TRNG. Thus the Shannon entropy of the TRNG is given by: lim

m→∞ E m (X m ), (11)
where (X m ) m≥0 is a sequence of Markov chains with memory m approximating the output distribution of the TRNG. This definition of the entropy rate of the TRNG may seem to be theoretical, but as we will explain shortly, this sequence converges rapidly, so that in practice m = 10 is usually sufficient to obtain a very good approximation of the entropy rate of the TRNG.

Before explaining the main ingredients of the algorithm, we specify the security model of the TRNG. According to the well known Kerckhoffs principle, we assume that the attacker has complete knowledge of the TRNG including its initial state. Moreover, we Algorithm 3: Algorithm to compute the Shannon entropy of a Markov chain.

input :

• f X(X∞,T (X)) the encoding function of X = X(X ∞ , T (X)).

output: The Shannon entropy of X. assume that the attacker has infinite computational power and is able to observe the preceding TRNG output bits. The attacker aims to predict the next bit of the TRNG from this knowledge.

1 S ← 0 ; 2 for s ∈ S m do 3 pr = f X(X∞,T (X)) (s + ′ 0 ′ ) + f X(X∞,T (X) (s + ′ 1 ′ ); /*
In this context, we can interpret the entropy rate of the TRNG as the quantity of additional information the attacker needs, to be able to perfectly predict one output bit of the TRNG. For instance, if the entropy rate is 1, the attacker would need full information contents of the following bit, which is therefore unpredictable. The general idea behind the algorithms presented in this paper is to compute an approximation of the statistical distribution of the TRNG output by modeling the attacker's knowledge using a Markov chain with memory m, for an m that is big enough to approximate the entropy rate of the TRNG via Eq. ( 10) with sufficient precision.

Using the assumptions we made on the EO-TRNG in Section 2, the state of an EO-TRNG at time t is given by the total phase of the sampling oscillator ω(t + ξ(t)). Indeed, from this knowledge, according to Eq. ( 1), the attacker can predict the output of the EO-TRNG at time t via a deterministic function f α representing a period of the sampled oscillator featuring duty cycle α.

The attacker's knowledge of the phase of an EO-TRNG can be represented by a random variable X e (t) with values in R. Then the distribution of the output bit at time t is given by the random variable f α (X e (t)). Let p e (t, x) : R × R → R be the statistical distribution of X e (t). By following the evolution of this distribution over time, one can compute a Markov chain with memory m associated with the EO-TRNG and from the Markov chain the corresponding entropy rate. The evolution of p e (t, x) depends on two parameters:

• Physical noises, which tend to decrease the attacker's knowledge of the state of the generator;

• The sequences of output bits, which allow the attacker to get some information about the internal state of the generator.

To compute a Markov chain with memory m associated with a multi-oscillator-based TRNG (MO-TRNG) composed of ℓ elementary oscillator-based TRNGs, EO-TRNG i for i = 1, . . . , ℓ, at least two approaches are possible:

1. One can consider the space of phases V of all EO-TRNGs, with the dimension of ℓ (since we have seen that the phase space of one EO-TRNG has the dimension of 1) and then represent the attacker's knowledge by a random variable X(t) on V , compute the evolution of X(t) and the distribution of the output bits by f α1,...,αn (X(t)), where f α1,...,αn is a multi-dimensional sampling function.

2. One can compute for i = 1, . . . , ℓ, Markov chains (X i j ) j≥0 with memory m for EO-TRNG i , and then compute a final Markov chain with memory m obtained by combining the outputs of Markov chains X i using the entropy conditioning function.

The first approach is very inefficient since it involves carrying out numerical integration in a space of the dimension of ℓ. In this paper, instead, we develop the second approach that is efficient and works for a general entropy conditioning function.

In Section 4, we explain how to compute a Markov chain with memory m associated with an EO-TRNG, and in Section 5, we describe an algorithm to compute a Markov chain, when the entropy is conditioned from ℓ Markov chains.

Modeling the EO-TRNG using a Markov chain

In this section, we provide an algorithm to compute a Markov chain X = (X j ) j≥0 representing the statistical distribution of output values of an EO-TRNG. Based on what we said above, we can and will assume that the EO-TRNG is only subject to thermal noise. We assume we have an EO-TRNG characterized by input parameters α (i.e. the duty cycle of the sampled oscillator), µ (i.e. the drift of the Wiener process described in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF]), σ 2 (i.e. the volatility of the Wiener process described in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF]) that outputs a Markov chain with memory m. In Section 2, we explained how to derive (α, µ, σ 2 ) from measures of the duty cycle, clock periods, and phase jitters of a couple of ring oscillators.

Remark 2. Needless to say, in order to obtain a good approximation of the entropy rate of the EO-TRNG, the parameters (α, µ, σ 2 ) that serve as inputs in our algorithm have to be measured highly precisely. One of the main difficulties with this measurement is the need to distinguish between the contribution of the thermal noise to the phase jitter and contributions from other sources of noise. Indeed, when using the phase jitter measurement methods usually implemented in widely used oscilloscopes, the phase jitter distribution obtained will include not only the contribution of the thermal noise but also that of the flicker noise as well as of all the deterministic noises. Several techniques are described in the literature to evaluate the contribution of thermal noise (see for instance [START_REF] Fischer | Embedded Evaluation of Randomness in Oscillator Based Elementary TRNG[END_REF][START_REF] Haddad | On the Assumption of Mutual Independence of Jitter Realizations in P-TRNG Stochastic Models[END_REF]).

For n ∈ N, denote by X r (n) the random variable on S n such that P(X r (n) = s) for s ∈ S n is the empirical probability that the EO-TRNG outputs pattern s (we assume here that such an empirical probability exists). In other words, the probability distribution of X r (n) is the same as that of the empirical distribution of the output bits of the EO-TRNG grouped in patterns of length n.

In Section 3, we saw that a Markov chain X = X(X 0 , T (X)) with memory m determines a random variable X0 (m + 1) on S m+1 and that reciprocally, X0 (m + 1) encodes the initial state X 0 and transition matrix of X. Thus, the Markov chain with memory m, which best approximates the probability distribution of the EO-TRNG, is such that X0 (m + 1) is the random variable X r (m + 1). So we only need to explain how to compute X r (m + 1) from knowledge of the statistical parameters (α, µ, σ 2 ) of the EO-TRNG.

Remark 3. Let X = X(X 0 , T (X)) be the Markov chain defined by X r (m + 1). In general, the stable element of X will not be X 0 so that the evaluator will need to call on Algorithm 2 to compute X ∞ , in order to compute the entropy associated with X.

Let us denote by p(x, t|p 0 ) : R × R → R the distribution of probability at time t > t 0 representing the attacker's knowledge of the phase of the EO-TRNG under the hypothesis that at time t 0 the attacker's knowledge is given by the distribution p0 = p(x, t 0 ). As the sampled signal is 1-periodic, the output of the EO-TRNG at time t depends only on the phase of the EO-TRNG mod 1, so we can consider:

p : R × R → R (x, t) → p(x, t|p 0 ) = n∈Z p(x -n, t|p 0 ). (12)
Let C[0, 1] be the set of 1-periodic real valued functions f and let D[0, 1] ⊂ C[0, 1] be the set of integrable functions such that

G(µ, σ)(x) = n∈Z G(µ, σ)(x -n) ∈ D[0, 1].
Recall that α is the duty cycle of the sampled clock signal. We mark f 1 α = f α and f 0 α = 1 -f α . With these notations, the following result gives the probability that the EO-TRNG outputs bit b at time t knowing p(x, t|p 0 ) and shows how knowledge of b affects p(x, t|p 0 ): Proposition 1 ([3], A.1. Lemma 2). Let b ∈ {0, 1}, the probability P(X(t) = b) that the EO-TRNG with parameters (α, µ, σ 2 ) sampled at time t outputs bit b is:

P(X(t) = b|p(x, t|p 0 )) = 1 0 p(x, t|p 0 )f b α (x)dx. ( 13
)
Moreover, knowing that the output of the EO-TRNG at time t is bit b, the distribution of probability p(x, t|X(t) = b, p 0 ) is:

p(x, t|X(t) = b, p 0 ) = p(x, t|p 0 )f b α (x)/( 1 0 p(x, t|p 0 )f b α (x)dx). ( 14
) t y s 1 (t) t y s 1 (t)
Figure 3: Effect of sampling the clock signal equal to 0 (left) and 1 (right) depending on the distribution p(x, t), s 1 (t) is the sampled clock signal.

Figure 3 shows a graphical representation of the effect of sampling the clock signal equal to 0 and 1 following a Gaussian distribution p(x, t) (for clarity, in this figure, we use p(x, t) rather than p(x, t) as it is done in Proposition 1). Remark 4. Compared to [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF] where the authors compute in the frequency domain, we chose to do our computations in the time domain. The two approaches are equivalent from an algorithmic point of view: we will see that we have to perform a product and a convolution product whether we represent p(x, t|p 0 ) in the time or in the frequency domain, so that we will have to do a discrete Fourier transform. We think that the approach in the time domain makes it easier to control the loss of precision in the computations: even when using a very naive Riemann integration algorithm, we obtain the lower and upper bounds of the correct result.

In the following, we define the sampling operator S(b, α) by:

S(b, α) : C[0, 1] → C[0, 1] S(b, α)(p)(x) = p(x)f b α (x). ( 15
)
The evolution of p(x, t) over time is given by the following proposition:

Proposition 2 ([3], A.1. Lemma 1). Assuming the attacker's knowledge of the phase of the EO-TRNG, modeled by a Wiener process with parameters (α, µ, σ 2 ), at time t 0 is given by p(x, t 0 ). Then for t > t 0 , we have:

p(x, t) = p(x, t 0 ) * G((t -t 0 )µ, (t -t 0 )σ 2 ), ( 16
)
where * is the convolution product.

In the following, we denote by E(µ, σ, ∆t) :

D[0, 1] → D[0, 1]
, the evolution operator such that:

E(µ, σ, ∆t)(p)(x) = p(x) * G(∆tµ, √ ∆tσ 2 ).
Figure 4 shows a graphical representation of the effect of time evolution on the Gaussian distribution p(x, t).

From the two preceding propositions, we immediately deduce the following: ). Let t 0 < t 1 < . . . < t n be the sampling times. We denote by T (α, µ, σ,

(t i ), (b i )) : C[0, 1] → C[0, 1]
, the operator defined by

T (α, µ, σ, (t i ), (b i )) = S(b n , α) • E(µ, σ, t n -t n-1 ) • . . . • S(b 1 , α) • E(µ, σ, t 1 -t 0 ) ( 17
)
Let P(X(t i ) = b i , i = 1, . . . , n|p 0 (x, t 0 )) be the probability that the EO-TRNG sampled at times (t i ) outputs the bit pattern (b i ). Then, we have:

P(X(t i ) = b i , i = 1, . . . , n|p 0 (x, t 0 )) = 1 0 T (α, µ, σ, (t i ), (b i ))p 0 (x, t 0 )dx. ( 18
)
Using Proposition 3, we obtain Algorithm 4, which can be used to compute the probability that the EO-TRNG outputs a given bit pattern b 1 . . . b n .

Distribution f ∈ D[0, 1] can be represented either in the time domain or in the frequency domain. In the time domain, f is given by a table of floating point numbers [f (i/k)] i=0,...,k . In this case, 1 0 f (x)dx can be computed via a Riemann integral, which gives upper and lower bounds of the correct result, making it possible to control the precision of the result. The computation of the integral in Step 3 for a fixed precision has a linear complexity in k. Step 4 has a linear complexity in k, too. The convolution product can be computed in the frequency domain in quasi-linear time O(k log(k)) by using a discrete Fourier transform. So the whole Algorithm 4 has a quasi-linear complexity O(k log(k)) in k measured in the number of floating point operations.

We end this section by addressing the choice of the distribution p 0 (x, t 0 ), which depends on the attacker's initial knowledge and memory m of the Markov chain. We discuss it in relation with the security model we use and the target precision of the entropy computation. The security model usually depends on the assumed power of the attacker. In our context, i.e. the attacker has infinite computation power, the difference between the security models is in the attacker's knowledge about the state of the TRNG: Definition 7. We define two security models for free-running oscillator based TRNGs according to the attacker's knowledge about the TRNG:

• Security model A: we assume the attacker has complete knowledge of the state of the TRNG at start-up and each time the TRNG outputs a bit;

Algorithm 4: Algorithm to compute the probability of a bit pattern at the output of an EO-TRNG. input :

• (α, µ, σ 2 ), the statistical parameters of the EO-TRNG;

• p 0 (x, t 0 ) ∈ D[0, 1], representing the initial attacker's knowledge about the phase of the EO-TRNG;

• ∆t the time interval between two samplings;

• n integers and b 1 . . . b n a bit pattern.

output: The joint probability P(X r (i) = b i , i = 1, . . . , n) that the EO-TRNG outputs bits b i .

1 p(x, t 0 ) = p 0 (x, t 0 );

2 for i ← 1 to n do 3 p(x, t) ← p(x, t) * G(µ∆t, σ 2 (∆t)) ; 4 p(x, t) ← p(x, t)f bi α (x); 5 end 6 return 1 0 p(x, t)dx;
• Security model B: each time the TRNG produces a bit, only the value of this bit is given to the attacker.

In Security model A, what we mean by the internal state of the TRNG is the phase and duty cycle of each oscillator in the TRNG. Thus, in this security model, each time the TRNG outputs a bit, the attacker is given the internal state of the TRNG from which the value of the output bit can be recovered. Of course, Security model A gives more power to the attacker than Security model B, so it is more stringent. Nonetheless, in real world scenarios, the attacker does not have access to the internal state of the TRNG. Thus, Security model A is not realistic apart from the start-up of the TRNG, when the initial relative phase of the two oscillators in the EO-TRNG could always be the same and may thus be known to the attacker.

Nevertheless, this first model is useful because it greatly simplifies computations. Indeed, each time the TRNG outputs a bit, the attacker gets complete knowledge of its state, so he/she does not need to take the preceding bits into account to predict the next one. Thus, all the useful information is contained in the initial distribution p 0 (x, t 0 ), which is a Dirac distribution δ(x 0 ) with all its mass concentrated in x 0 (here t 0 is either the start-up time of the TRNG or each time at which it outputs a bit). In this case, we do not need a Markov chain to model the output stream of the EO-TRNG, so we can assume that the memory depth m is equal to 0. Note that the explicit expressions for entropy computation published in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF][START_REF] Wu | On the Security of TRNGs Based on Multiple Ring Oscillators[END_REF] rely on this security assumption.

In Security model B, the attacker only obtains the value of the output bit each time the EO-TRNG outputs a bit. Taking into account continuous operation of the TRNG, this assumption may be viewed as realistic. Following Eq. ( 11), we should choose a sufficiently large memory depth m of the Markov chain, which determines the distribution of output bits of the EO-TRNG, so that the events that occur before the last m bits do not affect the value of the following bit.

To find such an m, we can consider two very different initial distributions by taking for p 0 (x, t 0 ) either the Dirac distribution or the uniform distribution. Then, we can use Algorithm 3 to compute entropy E D (m) (for the Dirac distribution) and E U (m) (for the uniform distribution) depending on m. For m big enough, one can check that entropies E D (m) and E U (m) converge towards the same value. For any m, we can take the smallest integer such that |E D (m)-E U (m)| < ϵ, ϵ being the desired precision of our computations. Table 1 gives values of E D (m) and E U (m) for an EO-TRNG with parameters (α, µ, σ 2 ) = (0.5, 1, 4.9 10 -3 ) and m = 1, . . . , 10. It shows that the convergence is rapid enough to achieve the required precision of 10 -3 with m = 10. We checked experimentally that the convergence is quicker when σ is bigger. To compute Table 1, we chose σ = 0.7 (which is in the order of typical values that we measure in real hardware implementations) to be sure of making a realistic assessment of the convergence. Remark 5. A Dirac distribution is easy to implement in our algorithms since we only use it to compute a convolution product and we can therefore define it just as distribution δ(x 0 ) such that (δ(x 0 ) * f )(x) = f (x -x 0 ). As x 0 is unknown, we have to choose the value that minimizes the entropy rate of the generator. There is no obvious solution to this problem, but our experience confirms that the entropy rate of the generator with parameters (α, µ, σ 2 ) for µ ∈]0, 1] (see the remark just after Definition 1) is minimal when µ = 1. This is also obvious in the entropy formula of [3, Proposition 1]. Moreover, if µ = 1, it is easy to choose the x 0 that minimizes the entropy rate: it is sufficient to take x 0 = α 0 /2.

Modeling the MO-TRNG including entropy conditioner

In this section, we assume that the MO-TRNG is composed of ℓ EO-TRNGs, denoted EO-TRNG i for i = 1, . . . , ℓ where EO-TRNG i is made of the sampling oscillator O 0 and the sampled oscillator O i . Their outputs are post-processed by an entropy conditioner (see Figure 2). In the previous section, we explained how to compute Markov chains (X i j ) j≥0 that approximate the statistical distribution of the output bits of EO-TRNG i . We are now interested in the problem of computing a Markov chain that describes the distribution at the output of the entropy conditioner. P ∈ F 2 [x 1 , . . . , x ℓ ], the evaluation of which enables recovery of ζ ℓ . It can be shown that the degree of P is bounded by ℓ. There are 2ℓ ℓ monomials of degree ℓ in F 2 [x 1 , . . . , x ℓ ]. So P can be evaluated by performing 2ℓ ℓ (ℓ + 1) operations each of which is of the form ζ 2 : bits 2 → bits. Algorithm 5 deduced from Proposition 4, makes it possible to compute ζ m 2 (X 1 j , X 2 j ) for an arbitrary ζ 2 : bits 2 → bits in time O(|S m+1 | 2 ). We deduce that ζ m ℓ (X 1 j , . . . , X ℓ j ), where ζ m ℓ is a general Boolean function, can be evaluated in O( 2ℓ ℓ (ℓ + 1)|S m+1 | 2 ). We can further improve the computation run time of ζ m ℓ (X 1 j , . . . , X ℓ j ), if we assume that ζ ℓ : bits ℓ → bits is given as the composition of ℓ times the same associative composition law ζ 0 ℓ : bits 2 → bits to get a running time of O(ℓ|S m+1 | 2 ). If, in addition, the Markov chains X 1 j , . . . , X ℓ j represent ℓ copies of the same Markov chain we can use a square and multiply algorithm to compute ζ m ℓ (X 1 j , . . . , X ℓ j ) in time O(log(ℓ)|S m+1 | 2 ). This last condition is fulfilled in the classical design where the MO-TRNG is obtained as the exclusive or function of outputs of ℓ EO-TRNGs that have the same specification.

Algorithm 5: Algorithm for computing ζ m 2 (X 1 j , X 2 j ). input : • f X i i = 1,
m 2 (X 1 , X 2 ). 1 ∀i ∈ S m+1 , X 3 [i] ← 0; 2 for x, y ∈ S m+1 × S m+1 do 3 i ← ζ m+1 2 (x, y); 4 X 3 [i] ← X 3 [i] + f X 1 [x].f X 2 [y] ; 5 end 6 return f X ζ 2 = X 3 ; /* Comment: We represent f X ζ
f X ζ 2 (s) = s ′ ∈Sm+1 f X 1 (s -ζ2 s ′ )f X 2 (s ′ ), (28)
Note that Eq. ( 28) is a convolution product of functions S k → R. Recall that if (G, + G ) is a finite commutative group, f, g : G → R are functions, (f * g)(x) = t∈G f (t)g(x-G t) is the convolution product of f and g that can easily be computed using a Fourier transform. Namely, let Ĝ be the dual group of G that is the group of characters χ : G → C * . If f : G → R is a function, we denote by f : Ĝ → R the function such that:

f (χ) = 1 |G| x∈G f (x)χ(-x). ( 29
)
Using the fact that χ∈ Ĝ χ(t) is 0 if t = 0 or |G| if t ̸ = 0, we deduce that for all x ∈ G f (x) = χ∈ Ĝ f (χ)χ(x). This shows that f makes it possible to recover f . In our context, f is the Fourier transform of f . Using the fact that Ĝ is canonically isomorphic to G, one can show that the map f → f is an involution i.e. f = f . Using the fact that t∈G χ(t) is 0 if χ ̸ = 0 and |G| if χ = 0, we easily get the well known proposition: Proposition 5. Let f, g : G → R be functions, we have for all χ ∈ Ĝ:

f * g(χ) = f (χ)ĝ(χ). ( 30
)
This proposition gives us a way to rapidly compute convolution product of f, g : G → R, provided that one can easily compute the Fourier transform in G.

Example 1. In the case that ζ 2 : bits 2 → bits is the xor map

(b 1 , b 2 ) → b 1 ⊕ b 2 then (S m , ζ m
2 ) is a group. The associated Fourier transform is called the Walsh transform and a quasi-optimal algorithm is known to compute it [START_REF] Fino | Unified Matrix Treatment of the Fast Walsh-Hadamard Transform[END_REF]. In this case we can use Algorithm 6 to compute ζ m 2 (X 1 j , X 1 j ) in time of order O(|S m+1 |). By combining the two optimizations, if the MO-TRNG is obtained by XOR-ing the outputs of ℓ EO-TRNGs with the same specification, one obtains an algorithm to compute the entropy rate of the TRNG with the running time complexity O(log(ℓ)|S m+1 |).

6 Validation of the model by simulations and its comparison with state-of-the-art MO-TRNG models

Using the proposed algorithms, we simulated several MO-TRNG configurations featuring different numbers of rings in order to compare our model with other state-of-the-art MO-TRNG models and to assess the impact of design choices on the entropy rate. All the simulated MO-TRNGs had the same architecture as that presented in Fig. 2 where, for the sake of simplicity, the oscillators O 1 , . . . , O ℓ producing the sampled signals had the same number of inverters. The entropy conditioner was implemented as an exclusive or (XOR) function.

The set of algorithms presented in this paper was implemented in Python available under GPL License. The whole set is freely accessible via GitHub [START_REF] Lubicz | TRNG Test Suite[END_REF].

We denote by EO-TRNG i the EO-TRNG made of the oscillator O i sampled at rising edges of the output signal of O 0 . For our computations, we assumed that EO-TRNG i for i = 1, . . . , ℓ has the following fixed parameters (see Definition 1): α i = 0.5 for the duty cycle and µ i = 1 for the drift of the Wiener process. We computed the entropy rate of the resulting TRNG with the quality factor varying in the interval [0.001; 0.1]. Recall that the quality factor (see [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF]Section 2.4]) is given by σ 2 ∆t where σ 2 is the volatility of the Wiener process and ∆t is the time interval between two subsequent samplings. Algorithm 6: Algorithm for computing ζ m 2 (X 1 j , X 2 j ) using Fourier transform. input :

• f X i i = 1, 2 the encoding functions of two Markov chains (X i j ) j≥0 with memory m associated with EO-TRNG i ;

• ζ m 2 : S m+1 × S m+1 → S m+1 a composition law such that:

-S m+1 together with the composition law ζ m 2 : S m+1 × S m+1 → S m+1 is a group;

an efficient algorithm exists to compute the Fourier transform of

f X i : S m+1 → R for i = 1, 2. output: The encoding function f X ζ 2 of the Markov chain ζ m 2 (X 1 , X 2 ). 1 f X i ← F T (f X i ) for i = 1, 2; 2 for χ ∈ Ŝm+1 do 3 f X ζ 2 (χ) ← f X 1 (χ). f X 2 (χ); 4 end 5 return f X ζ 2 = F T -1 ( f X ζ 2 ); /* Comment: We represent f X ζ 2 as a table
of floats indexed by S m+1 */

First, we compared our model with the EO-TRNG model of Baudet et al. provided in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF]. In the proof of Corollary 1 presented in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF], one can find the following closed approximate expression for the entropy rate at the output of an EO-TRNG depending on its quality factor:

E(Q) = 1 - 16 π 2 ln(2) e -4π 2 Q + O(e -6π 2 Q ). ( 31
)
The results obtained using this expression can be compared with the results given by our model using Fig. 5. Note that Eq. ( 31) is not accurate for small quality factors, since the error term becomes too big (note in particular the negative entropy rate for the quality factor sizes up to 0.02). When the quality factor increases further, the two models converge toward the same value of entropy and always remain within the margin of error. Note that the model of Baudet et al. proposed in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF] always underestimates entropy compared to the new model, the latter being more precise. We also checked that the results of our model regarding the computed bias were always within the error margin appearing at the end of Eq. (31). One could expect that, as for a cryptographic application, we would need to produce bits with high entropy rate and consequently, we would use a TRNG with a big quality factor where the discrepancy between the two models is small. Table 2 shows that this assumption is not correct: in the case of an MO-TRNG obtained by XOR-ing the outputs of ℓ = 64 EO-TRNGs, which can be a realistic number of rings in practice, to achieve the MO-TRNG entropy rate of 0.997 required by recommendations AIS 31 [START_REF] Killmann | A proposal for: Functionality classes for random number generators[END_REF], the required quality factor of individual EO-TRNGs would be 0.011. Note that this value is in the outputs of several EO-TRNGs by an exclusive or function, significantly increases the entropy rate. 7 Modeling and evaluation of the TRNG implemented in hardware and discussion

Next, we evaluated the relevance of our entropy estimation and entropy management methods for MO-TRNGs based on ring oscillators, which were implemented in hardware. We used a modular hardware dedicated to TRNG and PUF testing, which featured the Intel 5CEBA4F17C8N device from the Cyclone V FPGA family [START_REF] Laban | Platform for testing and evaluation of PUF and TRNG implementations in FPGAs[END_REF]. We implemented three versions of the MO-TRNG following the circuit diagram depicted in Fig. 2 where:

• the ring oscillator O 0 was always composed of 29 delay elements (one NAND gate and 28 buffers) and it generated the sampling (reference) clock signal of 69 MHz;

• in the three versions, the oscillators O i were made of respectively 39, 49, and 68 delay elements and produced sampled clock signals with mean frequencies of, respectively, 51, 40, and 28.9 MHz. Note that to evaluate the impact of the ring frequencies on the entropy, we set the number of delay elements to get approximately the same difference in mean frequencies between the three versions of the rings, i.e. about 11 MHz.

Remark 7. We recall that all ring oscillators are considered to be independent and unmanipulable sources of jittered clock signals in our MO-TRNG stochastic model. The independence of phases of generated clock signals can be ensured by a proper hardware design (e.g. by placing the rings far apart, avoiding parallel routing, placing a buffer at the ring output). The required independence can be easily verified as it was done in [18, Page 4] using a suitable oscilloscope (e.g. LeCroy WaveRunner 640Zi). Indeed, the authors show that the cumulative distribution function of the phase shift between two independent linearly on σ 2 T0 . This means that an EO-TRNG is more efficient (from the point of view of the entropy rate at its output), if the sampled signal has a higher frequency. This quite natural conclusion is confirmed by our model, as can be seen in the last column of Table 3, which gives the entropy rate of the EO-TRNG ν for ν = 39, 49, and 68 according to Security model B and the frequency divisor D set to 2000.

We underline the fact that the sampling oscillator had the same frequency in all implemented EO-TRNG ν versions and consequently, the output bit rate remained the same, i.e. it was independent of the number of delay elements of the sampled rings. At first glance, it may consequently seem that in order to increase the entropy rate, it is preferable to select the highest frequency of the sampled clock signals possible.

However, other constrains also have to be considered when taking decisions regarding the frequency of the sampled clocks:

• since the slopes of the rising edges and falling edges of the clock signal are usually very different and do not depend on the clock frequency, with increasing frequencies, the duty cycle moves further from its ideal value (0.5) -this increases the bias of the output bit values and decreases the entropy rate;

• rings can interlock more easily at high frequencies [18, Figures 18 and19] and decrease the output entropy rate, it is therefore preferable (especially in multiple ring oscillator based TRNGs) to reduce the frequency of generated clocks and to spread their frequencies, while also paying attention to their harmonics.

The aim of entropy management in MO-TRNG design is to achieve a prescribed entropy rate, e.g. 0.997 according to the current version of recommendations AIS 31 (version 2.0) [START_REF] Killmann | A proposal for: Functionality classes for random number generators[END_REF] or even 0.9998, as required by the new draft of AIS 31 (version 2.35) [START_REF] Peter | A proposal for Functionality classes for random number generators[END_REF], by choosing the number of EO-TRNGs and the value of the frequency divider. Of course there is a trade-off between the entropy rate, the bitrate and number of gates in the TRNG, i.e. its cost. In practice, two entropy management strategies can be applied:

• the number and the size of oscillators (i.e. the cost) is fixed and the designer needs to determine the accumulation time (i.e. the bit rate) required to reach the required entropy rate,

• the required bit rate is fixed and the designer needs to determine the size (the frequency) and the number of oscillators, required to reach the targeted entropy rate.

Applying the first strategy, we computed the value of D to achieve a Shannon entropy rate of 0.997 according to Security models A and B for the MO-TRNG (2,ν) with ν = 39, 49, and 68. The results are given in Table 4. Applying the second strategy, we computed the number of oscillators ℓ, so that the Shannon entropy rate at the output of the MO-TRNG (ℓ,ν) for ν = 39, 49, and 68 was 0.997, while the divider value D was fixed to 2000. The results are shown in Table 5.

The results presented in Tables 4 and5, allows us to conclude that while both security models (A and B) make it possible to compute a lower bound of the entropy rate at the MO-TRNG output, being overly pessimistic, Security model A has a huge impact in terms of cost and performance. Specifically, we can see that to achieve the same proven entropy rate: • while using the same area, the output bit rate computed using Security model A is only about 70% of what we can achieve using Security model B (see Table 4);

• to reach the same output bit rate with model A as with model B, we have to multiply the number of rings and consequently the generator cost by up to 300 (see Table 5).

In the last phase of our experiments, we compared the entropy estimations based on Security model B and the two entropy management strategies (fixed cost versus fixed bit rate) presented in Tables 4 and5 with results of five statistical tests following Test procedure B of AIS 31, version 2.0 [START_REF] Killmann | A proposal for: Functionality classes for random number generators[END_REF]: test T6 a) and b), test T7 a) and b) and T8. Note that for high quality results, the test T8 estimates Shannon entropy rate per output byte.

For each MO-TRNG configuration tested, we generated one million bytes of random data: by varying division factor D from 2000 to 25000 for the first entropy management strategy and by modifying the number of rings ℓ from 1 to 13, when the second strategy was evaluated. The results of tests are presented in Tables 6 to 8 for the first entropy management strategy and in Table 9 for the second one.

In addition to showing the success of the tests and entropy estimated by test T8, we also specify, for how many of the five tests of the AIS 31 Test procedure B the generated data failed. Here, it is interesting to note that the data always passed test T6 a).

The dark gray cells in Tables 6 to 8 correspond to values of division factor D from the right column of Table 4, while the cells highlighted in Table 9 correspond to the number of oscillators ℓ from the right column of Table 5. As could be expected, our entropy estimations are always more stringent than those given by test T8 in both entropy management strategies, mainly because the statistical tests can not distinguish the contribution of unpredictable and unmanipulable thermal noises from the contribution of auto-correlated low frequency noises such as flicker noise and the contribution of (ma-management tool for the evaluation of different options in the design space that represent a compromise between the cost and the best output bit rate while achieving the required level of security.

In the course of our study, we introduced two security models that are relevant when the entropy rate at the output of an MO-TRNG needs to be estimated. While Security model A has been implicitly used in previous works [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF][START_REF] Wu | On the Security of TRNGs Based on Multiple Ring Oscillators[END_REF], especially because it greatly simplifies computations, we have shown that it leads to an overly pessimistic underestimation of the entropy rate at the TRNG output, which can impact the cost and performance of the TRNG when one needs to reach a target entropy rate. Consequently, Security model B, which is even more realistic than model A, should be preferred when the entropy rate needs to be estimated. The only disadvantage of the Security model B compared to model A is that it involves more computations, caused essentially by the use of Markov chains, but, as we have shown in this paper, Security model B is still amenable to computations for real word MO-TRNG designs.

An interesting question for future research would be whether some function or a subset of functions could behave better with respect to the entropy rate per bit in the class of entropy conditioner functions. One possibility in this direction would be to generalize the analysis made by Dichtl in [START_REF] Dichtl | Bad and Good Ways of Post-processing Biased Physical Random Numbers[END_REF]. Since in our model, we are dealing with a general class of logic functions, this problem should not represent an insurmountable obstacle. The new TRNG model based on Markov chains should make evaluation of the efficiency of the new entropy conditioner even easier.

Figure 1 :

 1 Figure 1: Schematic diagram of an elementary oscillator-based TRNG (EO-TRNG).

Figure 2 :

 2 Figure 2: Schematic diagram of a multi-oscillator-based TRNG (MO-TRNG).

1 0

 1 f (x)dx = 1. It is clear that p(x, t|p 0 ) ∈ D[0, 1]. Let us denote by G(µ, σ)(x) the Gaussian distribution with mean µ and standard deviation σ and let

Figure 4 :Proposition 3 .

 43 Figure 4: Effect of evolution of time on the distribution p(x, t) for a short accumulation time (left panel) and long accumulation time (right panel), s 1 (t) is the sampled signal.

  m) 0.111 0.306 0.424 0.466 0.476 0.475 0.471 0.468 0.466 0.465 E U (m) 0.499 0.474 0.467 0.465 0.464 0.464 0.464 0.464 0.464 0.464 Table 1: Values of entropy E D (m) based on the Dirac initial distribution and of entropy E U (m) based on the uniform initial distribution for memory m = 1, . . . , 10.

  2 the encoding functions of two Markov chains (X i j ) j≥0 with memory m associated to EO-TRNG i ; • ζ m 2 : S m × S m → S m obtained as the bitwise operation of ζ 2 : bits × bits → bits. output: The encoding function f X ζ 2 of the Markov chain ζ

Figure 6 :

 6 Figure 6: Shannon entropy rate as a function of quality factor in an MO-TRNG composed of 1, 2 and 4 EO-TRNGs computed according to Security model A (left) and Security model B (right).

  Comment: pr is the probability of the state s */

	4	tr = f X(X∞,T (X) (s + ′ 0 ′ )/pr ;
		/* Comment: tr is the probability of transition to the next
		states of s labelled by 0	*/

5 S ← S + pr.(-tr log(tr) -(1 -tr) log(1 -tr) ; 6 end 7 return S ;

  2 as a table of floats indexed by S m+1 */ The second optimization is possible if for all k ≥ m, S k together with the composition law ζ k 2 : S 2 k → S k is a group. In this case, we use the convenient notation + ζ ℓ : S 2 k → S k for ζ k 2 : S 2 k → S k and denote by -ζ2 the inverse operation. For ℓ = 2, we can rewrite Eq. (27) as:

Table 4 :

 4 Value of D for model A Value of D for model B MO-TRNG (2,39) Setting the division factor D to achieve an entropy rate of 0.997 for MO-TRNG (2,ν) and ν = 39, 49, and 68, according to Security models A and B Value of ℓ for model A Value of ℓ for model B MO-TRNG (ℓ,39)

		10 483	7 898
	MO-TRNG (2,49)	20 560	14 809
	MO-TRNG (2,68)	32 896	23 694
		33	6
	MO-TRNG (ℓ,49)	273	9
	MO-TRNG (ℓ,68)	3562	12

Table 5 :

 5 Setting the number of oscillators ℓ to achieve entropy rate of 0.997 for MO-TRNG (ℓ,ν) with ν = 39, 49, 68 and D = 2000, according to Security models A and B.

The only general assumption we make is that the entropy conditioner has no memory so that it is defined by a function )). By combining using ζ ℓ the outputs of ℓ Markov chains with memory m, (X i j ) j≥0 , we obtain the sequence of random variables (X ζ ℓ ) j≥0 = (ζ m ℓ (X 1 j , . . . , X ℓ j )) j≥0 . The following lemma confirms that this sequence is a Markov chain, too. Lemma 3. Let (X i j ) j≥0 for i = 1, . . . , ℓ be Markov chains over S m . The sequence (X ζ ℓ ) j≥0 = (ζ m ℓ (X 1 j , . . . , X ℓ j )) j≥0 of random variables over S m is a Markov chain. Moreover, for all k ≥ m, we have:

Proof. To prove the first claim, we have to check the conditions of Definition 2. We can consider (X i j ) i=1,...,ℓ j≥0 as a sequence of random variables over S ℓ m . Being the joint probability distribution of (X i j ) j≥0 for i = 1, . . . , ℓ, it is clear that (X i j ) i=1,...,ℓ j≥0 is a Markov chain. We can compute:

as the sum:

which can be taken over all the (s i ν ) i=1,...,ℓ ν=n-k,...,n ∈ (S ℓ m ) k+1 such that for ν = n -k, . . . , n, ζ m ℓ (s 1 ν , . . . , s ℓ ν ) = x ν . Using the fact that (X i j ) j≥0 is a Markov chain, we observe that Eq. ( 21) is equal to:

the sum being taken over all the ( [START_REF] Sunar | A Provably Secure True Random Number Generator with Built-In Tolerance to Active Attacks[END_REF] is non other than

So that we have proved that

Because (X i j ) j≥0 is a Markov chain, we know that P(((

)) i=1,...,ℓ ) does not depend on n. Thus, as expressions [START_REF] Sunar | A Provably Secure True Random Number Generator with Built-In Tolerance to Active Attacks[END_REF] and ( 23) are identical, 20 we confirm that P(X

x n-1 ) = 0. Next, we prove the second claim of Lemma 3. It is clear that Eq. ( 19) is true for k = m, because using condition [START_REF] Fischer | Modern random number generator design -Case study on a secured PLL-based TRNG[END_REF] we obtain:

Moreover, by definition, we have for

) so by an inductive application of (5), we obtain Eq. ( 19). Remark 6. From the point of view of the two security models, each of the (X i j ) j≥0 determines the probability of guessing the next bit at the output of EO-TRNG i from knowledge of the m preceding bits. At first sight, one could think that (ζ m ℓ (X 1 j , . . . , X ℓ j )) j≥0 models the security threat when the attacker knows each of the output bits of the EO-TRNG i for i = 1, . . . , ℓ and tries to guess the next output bit of the entropy conditioner. However, this not the case: (ζ m ℓ (X 1 j , . . . , X ℓ j )) j≥0 models the probability of guessing the next bit at the output of ζ ℓ from knowledge of the m preceding bits at the output of ζ ℓ , which is precisely our security model of the MO-TRNG.

The preceding Lemma says that (ζ m ℓ (X 1 j , . . . X ℓ j )) i≥0 is a Markov chain with memory m. The second part of the Lemma makes it possible to compute the encoding function (see Definition 4) of this Markov chain. Proposition 4. Let (X i ) j≥0 = for i = 1, . . . , ℓ be Markov chains with memory m over alphabet bits. We denote by f X i their respective encoding function (see Definition 4).

Let f X ζ ℓ be the encoding function for ζ ℓ (X 1 j , . . . , X ℓ j ). For all s ∈ S m+1 , we have:

Proof. This is an immediate consequence of the fact that for all s ∈ S m+1 , f X ζ ℓ (s) = P( Xζ ℓ (m + 1) = s) by definition and the preceding Lemma.

We can use the expression from Proposition 4 to recover f X ζ ℓ from the knowledge of f X i . However, the algorithm obtained in this way is not practical, because the sums in Eq. ( 27) are calculated over the big sets S ℓ m+1 and S ℓ m so that the resulting run time complexity is in O(|S m+1 | ℓ ).

Fortunately, two optimizations are possible in most real world cases. Recall that bits = {0, 1}. In this case, ζ ℓ : bits ℓ → bits is a Boolean function that can be represented as an algebraic normal form. The algebraic normal form of ζ ℓ is just a polynomial The previous results concerning the EO-TRNG confirm that our approach based on Markov chains is more precise than that presented in [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF]. The MO-TRNG model presented in [START_REF] Wu | On the Security of TRNGs Based on Multiple Ring Oscillators[END_REF] extends the model from [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF] to the use of multiple oscillators as sources of randomness. Consequently, both models have the same characteristics regarding the impact of the quality factor on the entropy.

In Section 5, we showed that our method makes it possible to evaluate a lower entropy bound following Security model A from Definition 7, on which the above cited models [START_REF] Baudet | On the Security of Oscillatorbased Random Number Generators[END_REF][START_REF] Wu | On the Security of TRNGs Based on Multiple Ring Oscillators[END_REF] (implicitly) rely, but, the new method also makes it possible to compute entropy with the more realistic Security model B.

Next, we assessed the impact of the choice of the security model on the proved lower bound of the entropy rate at the output of the MO-TRNG for ℓ = 1, 2 and 4. The results are presented in Fig. 6. On the left panel in Fig. 6, we present the entropy rate computed with Security model A, and on the right one, the rate was computed with Security model B.

We can see that the entropy rate of the latter is significantly bigger than that of the former. Also, as expected, in both cases, the entropy conditioner, which combines the 24]. It is also well known that ring oscillators are vulnerable to frequency attacks [START_REF] Markettos | The Frequency Injection Attack on Ring-Oscillator-Based True Random Number Generators[END_REF][START_REF] Bayon | Electromagnetic analysis on ring oscillator-based true random number generators[END_REF] during which the rings can lock to the frequency of the external signal. Fortunately, this kind of attacks can be easily detected by measuring online the jitter variance, as it was proposed in [START_REF] Fischer | Embedded Evaluation of Randomness in Oscillator Based Elementary TRNG[END_REF]. This possibility is important to ensure that the Security model B is valid. The same measures, which can constitute a basis for dedicated statistical tests, would be able to detect entropy variations caused by aging, process variation, self-heating up, etc.

To obtain comparable results, we fixed the placement and routing of all oscillators (i.e. of that generating the reference clock, but also of those generating sampled clocks) for all MO-TRNG versions. We placed the rings far apart to avoid their mutual dependence and confirmed their independent behavior by oscilloscope. We denote by EO-TRNG ν the EO-TRNG made of ν delay elements (inverters and buffers) and by MO-TRNG (ℓ,ν) the MO-TRNG made of ℓ EO-TRNG ν .

First, we set the division factor D to 1 and generated bit streams (b i ) i=1,...,κ of κ = 10 6 EO-TRNG ν output bits. From the bit streams obtained, using algorithms published in [START_REF] Fischer | Embedded Evaluation of Randomness in Oscillator Based Elementary TRNG[END_REF], we computed:

• the duty cycle of the sampled oscillator as E(b i ) = ( b i )/κ;

• the ratio T 0 /T x mod 1 (more precisely min(T 0 /T x mod 1, 1 -T 0 /T x mod 1)), where we denote by T 0 (resp. T x ) the mean period of the sampling (resp. the sampled) oscillator in the EO-TRNG x as 1/2E(b i ̸ = b i+1 ) according to [10, Fact 2];

• the volatility σ 2 T0 of the associated Wiener process σ 2 0 according to Eq. ( 2) using [10, Fact 1].

The results are presented in Table 3. Recall that the method in [10] outputs σ 2 T0 , which is the variance of the jitter accumulated during T 0 when T 1 has been scaled to 1. It means that if D is the value of the divider from Fig. 1 then the quality factor of the EO-TRNG is equal to Dσ 2 T0 . Note that in Table 3, the value of σ 2 T0 increases with the clock frequency (i.e. in our case, it decreases with number of delay elements included in the ring). But in the previous paragraph, we have seen that the quality factor of the EO-TRNG depends

Conclusion and perspectives

In this paper, we proposed a complete set of algorithms aimed to compute the entropy rate at the output of oscillator based TRNGs using differences in phases of generated clocks as a source of randomness. are publicly available. They should play an essential role in the design and evaluation of oscillator-based TRNGs, where they can be used to assess the level of security of the TRNG aimed at cryptographic applications. They can also be used as an entropy