a physical approach for stochastic modeling of tero · pdf file · 2017-01-26a...

18
TERO P-TRNG TERO analysis P-TRNG model Conclusions A Physical Approach for Stochastic Modeling of TERO-based TRNG Patrick Haddad 1,2 , Viktor FISCHER 1 , Florent BERNARD 1 , and Jean NICOLAI 2 1: Jean Monnet University Saint-Etienne, France 2: ST Microelectronics Rousset, France CHES 2015 – Saint-Malo, France September 2015 1/18 P. HADDAD, V.FISCHER,F.BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Upload: lytu

Post on 17-Mar-2018

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions

A Physical Approach for Stochastic Modelingof TERO-based TRNG

Patrick Haddad1,2, Viktor FISCHER1, Florent BERNARD1,and Jean NICOLAI2

1: Jean Monnet University Saint-Etienne, France

2: ST Microelectronics Rousset, France

CHES 2015 – Saint-Malo, France

September 2015

1/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 2: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions

Random numbers in cryptography

I Random number generators constitute an essential part of(hardware) cryptographic modules

I The generated random numbers are used as:Cryptographic keys (high security requirements)Masks in countermeasures against side channel attacksInitialization vectors, nonces, padding values, ...

2/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 3: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions

Random numbers in logic devices

RANDOM NUMBER GENERATORS(RNG)

DETERMINISTICRNGs (DRNGs)

PHYSICAL TRUE RNGs (P-TRNGs)

DRNG + P-TRNG = Hybrid RNG

3/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 4: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions

Classical versus modern TRNG evaluation approach

I Two main security requirements on RNGs:R1: Good statistical properties of the output bitstreamR2: Output unpredictability

I Classical approach:Assess both requirements using statistical tests – often impossible

I Modern ways of assessing security:Evaluate statistical parameters using statistical testsEvaluate entropy using entropy estimator (stochastic model)Test online the source of entropy using dedicated statistical tests

Our objectives

Propose a stochastic model of TERO-based TRNG a

Based on physical parameters quantifiable inside the deviceCan be used for online entropy assessment

a M. Varchola and M. Drutarovsky, New high entropy element for FPGA basedtrue random number generators, CHES 2010

4/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 5: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions Principle Implementation Modeling

Transition effect ring oscillator (TERO)

Principle:I Even number of inverters and two control gates in a loopI Oscillates temporarily because of the difference in two branchesI Number of oscillations varies because of the intrinsic noise

. . .

. . .Vctr Vout1

Vctr

Vout1

5/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 6: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions Principle Implementation Modeling

TERO-based P-TRNG

Implementation:

cnt[0]

Counter of rising edges

clk

nreset

cnt[7:0]8 Random

bit outputRequest of a random bit

. . .

. . .

TERO

I An asynchronous 8-bit counter counts random number ofoscillations

I We use the counter to characterize the TERO

I The LSB of the counter (cnt(0)) is used also as the random bit(TRNG output)

6/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 7: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions Principle Implementation Modeling

Outlines of the modeling

Since the P-TRNG is periodically restarted, the counter values aremutually independent, therefore:

Entropy =−p1 · log2(p1)− (1−p1) · log2(1−p1),

where p1 = Pr{cnt(0) = 1}.

We want to determine p1, therefore, we need to analyze andcharacterize the distribution of counter values.

7/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 8: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions Inverter Chain of inverters Loop of inverters

A noiseless inverter

Behavior of a noiseless inverter:

VinVCC

Vin Vout

VGND

VCC

VGND

Vout

Pin

Pout

VCC2

T1

Comparator Delayelement

Slopelimiter

Vin(t) Vout(t)

VCC

GND

Analyzed by Reyneri et al., 2 they determined Pout = f (Pin)

2 Reyneri et al., Oscillatory metastability in homogeneous and inhomogeneousflip-flops, IEEE SSC, 1990

8/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 9: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions Inverter Chain of inverters Loop of inverters

A noisy inverter

Behavior of a noisy inverter:

Noiseless

Gaussian noise

Low level assumptions

Vin

VCC

VGND

Pin

Vin(t) Vout(t) = Vout(t) + n(t) id

VCC

GND

In the paper, using the model of Reyneri et al., we determinePout ∼N (f (Pin),σ

2) (see Lemma 1)

9/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 10: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions Inverter Chain of inverters Loop of inverters

An chain of M inverters

Impact of the noise on a chain of inverters:

M inverters

Vin

VCC

VGND

Pin Vin Vout

We apply Lemma 1 to each inverter of the chain

We obtain Pout ∼N (F(Pin,M),G(σ2,M))

10/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 11: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions Inverter Chain of inverters Loop of inverters

A loop of inverters

Impact of the noise on the duty cycle:

Vctr Vout1

. . .

. . .

delay 1

delay 2

Vout1

X(s)

t

sth cycle

X (s)∼N (τ1+τ22

+τ2−τ12

⋅Rs ,σ2⋅ R2 s+1−1(1+H d)

2−1)

Geometricseries (ratio R)

11/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 12: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions TERO to P-TRNG Experiments Entropy

Stochastic model of TERO P-TRNG

The model characterizes distribution of counter valuesI Objective: We want to get Pr{cnt = s}I We just know the distribution of X(s)

We can use the equivalence cnt > s ⇐⇒ X(s)> 0Then

Pr{cnt > s}= 12

[1−erf

(K · 1−Rs−s0

√R2s+1−1

)]R is the ratio of the geometric seriesK reflects the jitter σ2

s0 reflects the difference τ1− τ2

andPr{cnt = s}= Pr{cnt ≤ s}−Pr{cnt ≤ s+1}

12/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 13: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions TERO to P-TRNG Experiments Entropy

Experimental validation

Validation of the modeled distribution using a χ2 test

Experiment: TERO 1 in an ST Microelectronics 28 nm ASIC

0,04

0,06

0,02

80 90

Modeled distribution

Gaussian law

Experimental data

100 110

K=35,680s0=94,152R=1,0153Pr

{cnt=s}

For a significance level α = 0.05 and 38 degrees of freedom, the teststatistic has to be lower than 53.384

Our model: the test statistic is 40.35Gaussian law: the test statistic is 149.3

13/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 14: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions TERO to P-TRNG Experiments Entropy

Experimental validation

Validation of the modeled distribution using a χ2 test

Experiment: TERO 2 in an ST Microelectronics 28 nm ASIC

K=9,6939s0=90,675R=1,013

Modeled distribution

Gaussian law

Experimental data

70 100

0,02

0,010,015

0,005

130 160 190

Pr{cnt=s}

For a significance level α = 0.05 and 76 degrees of freedom, the teststatistic has to be lower than 97.351

Our model: the test statistic is 33.97Gaussian law: the test statistic is > 106

14/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 15: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions TERO to P-TRNG Experiments Entropy

Entropy estimation

From our physical analysis we know Pr{cnt = s}From Pr{cnt = s} we compute p1 = Pr{cnt(0) = 1}

Recall: Since the TERO is periodically restarted, the subsequentcounter values are mutually independent and thus

Hsample =−∑s∈N

ps log2(ps)

Hlsb =−p1 · log2(p1)− (1−p1) · log2(1−p1)

The second term represents the entropy of our TERO P-TRNG

15/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 16: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions TERO to P-TRNG Experiments Entropy

Estimated entropy

Application of the model to TERO 1 and TERO 2

0,04

0,06

0,02

80 90

Modeled distribution

Gaussian law

Experimental data

70 100

0,02

0,010,015

0,005

130 160 190100 110s s

K=35,680s0=94,152R=1,0153H sample=4,47H lsb>0,999

K=9,6939s0=90,675R=1,013H sample=6,32H cnt (0)>0,999

Pr{cnt = s} Pr{cnt = s}

I In the two cases the entropy of the raw binary signal exceedsthe value 0.997 required by AIS31

I All generated bit streams passed tests T0 to T8 of AIS 31

16/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 17: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions

Conclusions

I We presented a stochastic model of the TERO P-TRNG

I The model is based on transistor-level assumptions

I The model was validated in an ASIC implemented using 28 nmST Microelectronics technology

I We derived the entropy from this model

I The entropy and the output bit rate can be easily managed usingthe model

17/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG

Page 18: A Physical Approach for Stochastic Modeling of TERO · PDF file · 2017-01-26A Physical Approach for Stochastic Modeling of TERO-based TRNG ... An asynchronous 8-bit counter counts

TERO P-TRNG TERO analysis P-TRNG model Conclusions

This work has received fundings from the European Union’s Horizon 2020 research and innovation programme in the framework of the project HECTOR

This work has received fundings from the European ENIAC Joint Undertaking (JU) in the framework of the project TOISE

Our thanks to Nicolas Bruneau, Michel Agoyan and Yannick Tegliafor their help and availability in numerous discussions.

ĎAKUJEM

18/18 P. HADDAD, V.FISCHER, F. BERNARD, J. NICOLAI Stochastic Model of TERO-based TRNG