• Aucun résultat trouvé

A Simulator for Evaluating the Leakage in Arithmetic Circuits

N/A
N/A
Protected

Academic year: 2021

Partager "A Simulator for Evaluating the Leakage in Arithmetic Circuits"

Copied!
25
0
0

Texte intégral

(1)

HAL Id: hal-01841048

https://hal.archives-ouvertes.fr/hal-01841048

Submitted on 17 Jul 2018

HAL

is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire

HAL, est

destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

A Simulator for Evaluating the Leakage in Arithmetic Circuits

Audrey Lucas

To cite this version:

Audrey Lucas. A Simulator for Evaluating the Leakage in Arithmetic Circuits. CryptArchi 2018 -

International Workshop on Cryptographic architectures embedded in logic devices, Jun 2018, Lorient,

France. pp.1-24. �hal-01841048�

(2)

A Simulator for Evaluating the Leakage in Arithmetic Circuits

Audrey LUCAS

CNRS, IRISA UMR 6074

CryptArchi 2018

(3)

Introduction

Outline

1

Introduction

2

Simulator for Evaluating the Leakage in Arithmetic Circuits

3

Experimentation Results

4

Conclusion

(4)

Introduction

Elliptic Curves Cryptography (ECC) over F

p

E

:

y2

=

x3

+

ax

+

b

Point

doubling: DBL 6=

Point

addition: ADD

Scalar multiplication (SM)

[k]P =

P

+

P

+ . . . +

P

(5)

Introduction

Scalar Multiplication Example

Algorithm 1:

Double and add

Input: P

and

k

= (k

m−1

, . . . ,

k0

)

2 Result:

[k]

·P

T ← O

for i

=

m

1

to

0

do T

2

·T DBL

if ki

= 1

then

TT

+

P ADD

returnT

DBL ADD 1

DBL 0

DBL 0

DBL 0

DBL ADD 1

Time

(6)

Introduction

Physical Attacks

Observation: Side Channel Attacks (SCA)

Computation time, power consumption, electromagnetic radiation, . . . Simple power analysis (SPA), differential power analysis (DPA), . . .

Side channel attacks

CryptArchi Cryptosystem hu#dzs7axm

(7)

Introduction

Physical Attacks

Perturbation: Fault Attacks (FA) Clock, supply voltage, laser, . . . Bit flip fault, stuck-at fault, . . .

Safe error, differential fault analysis (DFA), . . .

hu#dz7axm0avc CryptArchi

hu#dzec14@qaf

CryptArchi

(8)

Introduction

Physical Attacks

Countermeasures against SCAs

Randomization: scalar masking, point blinding, scalar recoding, . . . Uniformization: uniform curve, regular algorithm, . . .

Hardware: specific logic styles, reconfiguration, . . .

Countermeasures against FAs Hardware: shielding, sensor, . . .

Redundancy calculation: time, space, . . .

ECC case: verification of point coordinates onto the elliptic curve.

(9)

Introduction

Problem

Protection for one type of attacks may leave the system vulnerable on other type of attacks.

DBL ADD

1

DBL ADD

1

DBL ADD

0

DBL ADD

0

DBL ADD

1

Regular SM

DBL ADD

1

DBL ADD

1

DBL ADD

0

DBL ADD

0

DBL ADD

1

Regular SM and FA countermeasure

Are FA countermeasures resistant against SCA?

(10)

Simulator for Evaluating the Leakage in Arithmetic Circuits

Outline

1

Introduction

2

Simulator for Evaluating the Leakage in Arithmetic Circuits Simulator Characteristics

Simulator Behavior

3

Experimentation Results

4

Conclusion

(11)

Simulator for Evaluating the Leakage in Arithmetic Circuits Simulator Characteristics

Simulator for Evaluating the Leakage in Arithmetic Circuits

Objective

Detection of strength/weakness of:

Data representation (field element, point of curve) Computation algorithms (field and curve levels) Attacks:

Identify potential arithmetic leaks

Use these leaks for preparing some SCAs (e.g. template attacks)

attacker knows where to search in real traces

Protections:

Help designer to locate the leaks at design time

Countermeasures evaluation (e.g. against FA)

(12)

Simulator for Evaluating the Leakage in Arithmetic Circuits Simulator Characteristics

Preliminary

The simulator should be accurate but fast (VHDL simulations are too slow).

Typical Targeted Architecture w-bit microcontroller:

arithmetic units: adder (wadd), multiplier (wmul) control

register file . . .

Simulated Architecture for Experiment

Focus on w= 32 and arithmetic units

(13)

Simulator for Evaluating the Leakage in Arithmetic Circuits Simulator Characteristics

Preliminary

Implemented in Python and SageMath

Arithmetic

Field operation modulo

p

(p generic) Montgomery representation (β = 2

32

) Multiplication with Karatsuba

Montgomery reduction

Notations

Field addition: fadd

Field multiplication: fmul

(14)

Simulator for Evaluating the Leakage in Arithmetic Circuits Simulator Behavior

Formulas Integration

Formulas Integration

Create a table for formulas

1 line corresponds to 1 field operation

Field operation: 2 inputs and 1 output

Operation scheduling according to dependencies

Add "step" notion (latency)

1fmul by step

manyfadd by step

Output Inputs Ope Step

xx X1

,X

1

fmul

T0 X1

,Y

1

fadd 1

T1 T0

,T

0

fadd

M T1

,T

0

fadd

A M,M

fmul

T2 xx,T1

fadd 2

B T2

,T

0

fadd

X B,B

fadd

.. .

(15)

Simulator for Evaluating the Leakage in Arithmetic Circuits Simulator Behavior

Formulas Integration

(16)

Simulator for Evaluating the Leakage in Arithmetic Circuits Simulator Behavior

Activity Monitoring

Each field operation uses several arithmetic units Recording of input and output in all arithmetic units Obtained activity traces for field operations

estimated by Hamming weight (HW) variation

Field Addition Example

y0 x0

y1 x1

X

= (x

0

,

x1

, . . .)

232 Y

= (y

0

,

y1

, . . .)

232

32-bit words

(17)

Simulator for Evaluating the Leakage in Arithmetic Circuits Simulator Behavior

Fusion of Traces

The global trace is constructed by fusion of field operations traces During fmul, adder is sometimes idle

When adder is idle in fmul⇒ fadd is performed in parallel of fmul Parallelization aspect in order to be close to processor

fmul C=A×B

D=A+B E=AB F=D+E

... G=F+F

fadds

Time

(18)

Experimentation Results

Outline

1

Introduction

2

Simulator for Evaluating the Leakage in Arithmetic Circuits

3

Experimentation Results

4

Conclusion

(19)

Experimentation Results

Experimentation

Operation sequence: 3 fadds fadd algorithm: µNaCl library

Cryptography library for microcontrollers ECC: Montgomery curve

Random inputs

(20)

Experimentation Results

Trace of 3 Field Additions

(21)

Experimentation Results

Trace of 3 Field Additions

HW variation (%)

Cycle number Average 0

0.1 0.2 0.3 0.4 0.5 0.6

0 5 10 15 20 25 30 35 40 45 Standard deviation

(22)

Experimentation Results

Discussion

Mathematical validation

Comparison between result simulation of computation with SageMath

Strengths

Faster simulation than using VHDL description

data width > 100-bit⇒Very slow in VHDL

Simulator can be configurable

Adaptable to many curves, algorithms and mathematical objects representations

Adaptable to various numbers of wadd and wmul

Future work

(23)

Conclusion

Outline

1

Introduction

2

Simulator for Evaluating the Leakage in Arithmetic Circuits

3

Experimentation Results

4

Conclusion

(24)

Conclusion

Conclusion

What is done

Low level arithmetic simulator:

for Weierstrass curve for Montgomery curve

Future works

Architecture model calibration

Implementation and evaluation of protections against FA

Use the simulator for prepare and optimize attacks

(25)

Conclusion

Thank you for your attention.

Questions?

Références

Documents relatifs

Muller, Worst cases for correct rounding of the elementary functions in double precision, 15th IEEE Symposium on Computer Arithmetic (ARITH-15), June 2001..

Over all the custom operators, we observe on the ST231 that for the binary32 format and ◦ = RN, the specialized operators introduce speedups ranging from 1.4 to 4.2 compared with

— By using the method of function field arithmetic, we associate, to each graded linear series which is birational and of sub-finite type, a convex body whose Lebesgue

We used Magma [1] to construct Table 3 which confirm our guess by comparing the densities of the best known Kummer extended bases to the densities of the best known

The first allows the user to choose field (size and discretization) and input parameters.. The second section gives the user the option of calculating excitatory and inhibitory

However, most computer algebra systems feature highly-optimized univariate polynomial multiplication for the basic rings (such as Z, Q, F q ,. ), therefore Kronecker substitution

where K is the vibration force-constant; a the distance of the well bottom from the emitter's electrical surface; c, and cn the atomic and ionic F2 energy-term

The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.. L’archive ouverte pluridisciplinaire HAL, est