International Association for Cryptologic Research

International Association
for Cryptologic Research

Transactions on Cryptographic Hardware and Embedded Systems, Volume 2024

Impact of the Flicker Noise on the Ring Oscillator-based TRNGs


README

Introduction

This directory contains the relevant files to generate results and figures for our CHES 2024 paper "Impact of the Flicker Noise on the Ring Oscillator-based TRNGs".

Instructions

Here are step-by-step instructions for generating the figures.

python3 -m venv .venv
source .venv/bin/activate
pip install numpy matplotlib colorednoise
python generate_figures.py

The generate_figures.py file is supposed to generate directly the Figures presented in the article, whith the exception of the histograms for which the raw data cannot be made public.

The different parts of the script are organised as follows:
1. line 26 -line 143 : Emulation of ASIC results
2. line 151 - line 239 : Emulation of FPGA results (raw data from fpga_counter.txt file)
3. line 246 - line 421 : Elementary RO-TRNG bit generation using the emulator and entropy rate calculation for different configurations of noise (thermal and flicker)
4. line 431 - 594 : Study of the autocorrelation:
4.1. line 442 - line 467 : Study and trace the autocorrelation of a raw time data series
4.2. line 471 - line 594 : Study of the autocorrelation function of the bit series for different configurations of noise (thermal and flicker)
5. line 598 - line 628 : Trace the absolute jitter for different configurations of flicker noise (1x and 10x standard quantity from ASIC)

Description of the different fonctions :
1. LSNE(x,y,a) - implementation of the Least squares normalized Error Regression algorithm from [GB06] to obtain the coefficients of the quadratic behaviour of jitter
exemple of use: poly=LSNE(x_values,y_values,[2,1,0]) # [2,1,0] for the coefficients of order 2,1,0 respectively

  1. ERO_bits(T1,T2,Ath,Afl,N,size) - generates bits corresponding to an Elementary RO-TRNG
    ! the proportionality coefficients for thermal and flicker noise need to be defined or calculated first! (generally: factor_th=2, factor_fl=0.135)
    variable definition:
    1.T1/T2 - periods of RO1, RO2, from which RO2 with jitter RO1 perfect - transfer of all jitter onto RO2
    2.Ath,Afl thermal and flicker nosie amplitudes !! without their proportionality coefficients !!
    3.N - frequency divider factor
    4.size - number of desired bits to be generated

example of use: ERO_bits(2e-9,2e-9,Ath,Afl,1000,int(1e7)) for 10M bits generated from two 2ns identical RO Elementary RO-TRNG with standard quantities of thermal and flicker noise, frequancy divider at 1000

  1. H_Baudet(T1,T2,a1,N) - determination of the minimum boundary of entropy according to [BLMT11]
    variable definition:

    1. T1/T2=periods of RO1, RO2
    2. a1 the linear coefficient of the prabolic curve of jitter corresponding to the amplitude of thermal noise
    3. N - frequency divider factor
  2. entropy(bit_series, order): - determination of the entropy rate
    variable definition:

    1. bit_series - input bit series
    2. order - size of the block of bits - 8 for 2^8 values
  3. entropy_16bits(bit_series, order=16) - idem entropy(bit_series, order), but order blocked at 16

  4. autocorrelation(bit_series,k_all=np.linspace(0,100,101).astype(int)) - general computation of the autocorrelation function
    variable definition:

    1. bit_series - input bit series
    2. k_all - numpy array of desired lag computation