From Trivial Composition to Full Verification and an Application to Masking in Hardware
GaΓ«tan Cassiers, FranΓ§ois-Xavier Standaert
UCLouvain (Belgium)
VeriSiCC Seminar, Paris, France, September 2019
and an Application to Masking in Hardware Gatan Cassiers, - - PowerPoint PPT Presentation
From Trivial Composition to Full Verification and an Application to Masking in Hardware Gatan Cassiers, Franois-Xavier Standaert UCLouvain (Belgium) VeriSiCC Seminar, Paris, France, September 2019 Side-Channel Analysis Side-Channel
From Trivial Composition to Full Verification and an Application to Masking in Hardware
GaΓ«tan Cassiers, FranΓ§ois-Xavier Standaert
UCLouvain (Belgium)
VeriSiCC Seminar, Paris, France, September 2019
Side-Channel Analysis
Side-Channel Analysis
Side-Channel Analysis
Side-Channel Analysis
Side-Channel Analysis
Side-Channel Analysis
Masking (e.g., Boolean π¦ = π¦0 + π¦1 + β― + π¦π)
Noisy leakages security: Goal (ideally): π β
π
MI(π;π΄) MI π; π΄ < MI ππ; ππ π
Masking (e.g., Boolean π¦ = π¦0 + π¦1 + β― + π¦π)
Noisy leakages security: Goal (ideally): π β
π
MI(π;π΄) MI π; π΄ < MI ππ; ππ π Bounded moment security: ΰ·
π1,π2,β¦,ππβ1
ππ π
(π-1)th order statistical moment (ideally)
Bounded moment security: ΰ·
π1,π2,β¦,ππβ1
ππ π
(π-1)th order statistical moment (ideally)
Masking (e.g., Boolean π¦ = π¦0 + π¦1 + β― + π¦π)
Noisy leakages security: Goal (ideally): π β
π
MI(π;π΄) MI π; π΄ < MI ππ; ππ π Probing security: Sets of (π-1) probes are of π (ideally)
π¦ = π¦0 + π¦1 + β― + π¦π
Security reductions
noisy leakages bounded moment probing
abstract-qualitative physical-qualitative physical-quantitative
[Barthe et al., Eurocrypt 2017]
[Duc et al., Eurocrypt 2014]
π¦ = π¦0 + π¦1 + β― + π¦π
What can go wrong? (e.g., when computing π. π)
π1π1 π1π2 π1π3 π2π1 π2π2 π2π3 π3π1 π3π2 π3π3 β π1 π2 π3
Example: probing π1 = π1. π1 + π2 + π3 reveals information on π (when π1 = 1) Issue #1. Lack of randomness (can break the independence assumption)
What can go wrong? (e.g., when computing π. π)
π1π1 π1π2 π1π3 π2π1 π2π2 π2π3 π3π1 π3π2 π3π3 + π
1
π
2
π
2
π
3
π
2
π
3
β π1 π2 π3
Issue #1. Lack of randomness (can break the independence assumption)
Β«refreshing gadgets Β»
the probing model
Β«refreshing gadgets Β»
the probing model
What can go wrong? (e.g., when computing π. π)
π1π1 π1π2 π1π3 π2π1 π2π2 π2π3 π3π1 π3π2 π3π3 + π
1
π
2
π
2
π
3
π
2
π
3
β π1 π2 π3
Issue #1. Lack of randomness (can break the independence assumption) Example: glitches (transcient values) Β« re-combine Β» the shares such that:
(detected in the bounded moment model)
ππ = π(π¦1 β π¦2 β π¦3) Issue #2. Physical defaults
(can break the independence assumption)
Β«refreshing gadgets Β»
the probing model
What can go wrong? (e.g., when computing π. π)
π1π1 π1π2 π1π3 π2π1 π2π2 π2π3 π3π1 π3π2 π3π3 + π
1
π
2
π
2
π
3
π
2
π
3
β π1 π2 π3
Issue #1. Lack of randomness (can break the independence assumption)
completeness Β» property
[β Theshold Implementations]
analyzed in the probing model! Issue #2. Physical defaults
(can break the independence assumption)
Technical challenge: scalability
π-probing security [ISW, 2004]: any π-tuple of shares in the protected circuit is independent
Technical challenge: scalability
π-probing security [ISW, 2004]: any π-tuple of shares in the protected circuit is independent
Problem: the cost of testing probing security increases (very) fast with circuit size and the # of shares (since β many tuples)
Technical challenge: scalability
π-probing security [ISW, 2004]: any π-tuple of shares in the protected circuit is independent
Problem: the cost of testing probing security increases (very) fast with circuit size and the # of shares (since β many tuples)
Technical challenge: scalability
π-probing security [ISW, 2004]: any π-tuple of shares in the protected circuit is independent
Problem: the cost of testing probing security increases (very) fast with circuit size and the # of shares (since β many tuples)
Does it go wrong (for hardware masking)?
Does it go wrong (for hardware masking)?
Does it go wrong (for hardware masking)?
these schemes are affected by concrete flaws
Consolidating Masking Scheme
Problem: most of the randomness cancels outβ¦
Consolidating Masking Scheme
Problem: most of the randomness cancels outβ¦ Fix proposed by De Cnudde (β CMS more similar to DOM) Composability remains unclear
Composability requirements (example)
π1 internal probes π2 output probes π1 + π2 β€ π π-(Strong) Non Interference [Barthe et al., CCS 2016]: a circuit gadget (e.g., f1) is NI (SNI) any set of π1 + π2 probes can be simulated with at most π1 + π2 (only π1) shares of each input D(input shares||probes) β D(input shares||simulation)
Composability requirements (example)
π1 internal probes π2 output probes π1 + π2 β€ π π-(Strong) Non Interference [Barthe et al., CCS 2016]: a circuit gadget (e.g., f1) is NI (SNI) any set of π1 + π2 probes can be simulated with at most π1 + π2 (only π1) shares of each input D(input shares||probes) β D(input shares||simulation) Theorem [trivial composition] β any composition of q-SNI gadget is q-SNI
Domain Oriented Masking
Domain Oriented Masking
β DOM-dep critical to compose but broken (& no fix)
Domain Oriented Masking
β DOM-dep critical to compose but broken (& no fix)
ignore physical defaults such as glitches & hardware-
are at best probing secure (so not provably composable)
(Refined) model and security definition
Glitch-extended probes: probing any output of a combinatorial circuit allows the adversary to
Example: π1 gives π, π and π
π1
(Refined) model and security definition
Glitch-extended probes: probing any output of a combinatorial circuit allows the adversary to
Example: π1 gives π, π and π
π1
(SNI-related) clarification: the adversary can also probe the stable register output π so both π1 and π2 appear in proofs
π2
(Refined) model and security definition
Glitch-extended probes: probing any output of a combinatorial circuit allows the adversary to
Example: π1 gives π, π and π
Definition: a gadget is glitch-robust π-SNI if it is π-SNI in the βglitch-extendedβ probing model
π1
(SNI-related) clarification: the adversary can also probe the stable register output π so both π1 and π2 appear in proofs
π2
(Refined) model and security definition
Glitch-extended probes: probing any output of a combinatorial circuit allows the adversary to
Example: π1 gives π, π and π
Definition: a gadget is glitch-robust π-SNI if it is π-SNI in the βglitch-extendedβ probing model
ππ
(SNI-related) clarification: the adversary can also probe the stable register output π so both π1 and π2 appear in proofs
β Sharesβ fan in of secure gadgets should be minimum
π2
(Refined) model and security definition
Glitch-extended probes: probing any output of a combinatorial circuit allows the adversary to
Example: π1 gives π, π and π
Definition: a gadget is glitch-robust π-SNI if it is π-SNI in the βglitch-extendedβ probing model
ππ
(SNI-related) clarification: the adversary can also probe the stable register output π so both π1 and π2 appear in proofs
β Sharesβ fan in of secure gadgets should be minimum β Output probes (excluded in the SNI count) must be stable
ππ
glitches & composable without glitches (not both)
Note: the problem must be solved jointly
glitches & composable without glitches (not both)
Note: the problem must be solved jointly
ISW mult. is glitch-robust π-SNI in 2 cycles
Example with:
ISW mult. is glitch-robust π-SNI in 2 cycles
The adversary can observe:
β We need to describe a simulator using π1 shares/input
ISW mult. is glitch-robust π-SNI in 2 cycles
1,2
to simul. with 2 shares/input
ISW mult. is glitch-robust π-SNI in 2 cycles
1,2
βͺ
π1, π2: use a 1st share of π, π βͺ π
1,2: random value
βͺ π£1,1 (π1π1): use a 2nd share of π βͺ π£2,1 (π2π1): use a 2nd share of a βͺ π£3,1 (π3π1 + π
1,3): random value
ISW mult. is glitch-robust π-SNI in 2 cycles
1,2
βͺ
π1, π2: use a 1st share of π, π βͺ π
1,2: random value
βͺ π£1,1 (π1π1): use a 2nd share of π βͺ π£2,1 (π2π1): use a 2nd share of a βͺ π£3,1 (π3π1 + π
1,3): random value
ISW mult. is glitch-robust π-SNI in 2 cycles
1,2
βͺ
π1, π2: use a 1st share of π, π βͺ π
1,2: random value
βͺ π£1,1 (π1π1): use a 2nd share of π βͺ π£2,1 (π2π1): use a 2nd share of a βͺ π£3,1 (π3π1 + π
1,3): random value
ISW mult. is glitch-robust π-SNI in 2 cycles
1,2
βͺ
π1, π2: use a 1st share of π, π βͺ π
1,2: random value
βͺ π£1,1 (π1π1): use a 2nd share of π βͺ π£2,1 (π2π1): use a 2nd share of π βͺ π£3,1 (π3π1 + π
1,3): random value
ISW mult. is glitch-robust π-SNI in 2 cycles
1,2
βͺ
π1, π2: use a 1st share of π, π βͺ π
1,2: random value
βͺ π£1,1 (π1π1): use a 2nd share of π βͺ π£2,1 (π2π1): use a 2nd share of π βͺ π£3,1 (π3π1 + π
1,3): random value
ISW mult. is glitch-robust π-SNI in 2 cycles
1,2
βͺ to simul. with 1 share/input
ISW mult. is glitch-robust π-SNI in 2 cycles
1,2
βͺ
π1, π2: use a 1st share of π, π βͺ π
1,2: random value
βͺ π1: random value (simulation with 1 share/input impossible with an extended probe on π1)
DOM-indep is glitch-robust π-NI in 1 cycle
β simulation of G(π£1,2) and G(π1) impossible without the three input shares of π & π
π1 π2 π3
Approaches to composition
strategy that is correct in the standard probing model remains valid in the robust probing model
Approaches to composition
strategy that is correct in the standard probing model remains valid in the robust probing model β Both trivial composition (e.g., using only SNI gadgets)
multiplications with SNI refreshes) can work
β tradeoff between verification complexity and performance
Approaches to composition
strategy that is correct in the standard probing model remains valid in the robust probing model β Both trivial composition (e.g., using only SNI gadgets)
multiplications with SNI refreshes) can work
β tradeoff between verification complexity and performance
& instrumental in our tool for full verification)
Approaches to composition
β Informally we expect trivial composition for free
Improving trivial composition
β Informally we expect trivial composition for free
β Trivial SNI composition must refresh linear gadgets
Improving trivial composition
(w.r.t. simulatability) as if shares were isolated β βshare-by-shareβ linear gadgets are PINI (formalizes the idea of circuit share in DOM/TIs)
Probe Isolating Non-Interference (PINI)
(w.r.t. simulatability) as if shares were isolated β βshare-by-shareβ linear gadgets are PINI (formalizes the idea of circuit share in DOM/TIs)
[Goudarzi & Rivain, 2017]
Probe Isolating Non-Interference (PINI)
is PINI
Hardware Private Circuits
Hardware Private Circuits
robust SNI Ref. robust SNI AND [Faust et al., 2018]: SNI-based PINI mult. in 4 cycles
Hardware Private Circuits
robust SNI Ref. robust SNI AND [Faust et al., 2018]: SNI-based PINI mult. in 4 cycles [Cassiers et al., 2019]: PINI maintained without output register & refresh randomness can be accumulated off-path (β¦remember this would not work with SNI)
Hardware Private Circuits
robust SNI Ref. robust SNI AND [Faust et al., 2018]: SNI-based PINI mult. in 4 cycles [Cassiers et al., 2019]: PINI maintained without output register & refresh randomness can be accumulated off-path
β optimization of [Faust et al., 2018] or fix of DOM
Hardware Private Circuits
robust SNI Ref. robust SNI AND [Faust et al., 2018]: SNI-based PINI mult. in 4 cycles [Cassiers et al., 2019]: PINI maintained without output register & refresh randomness can be accumulated off-path
that is provably composable at arbitrary orders
composition are an interesting open problem
advantage of the input refreshing asymmetry
Other PINI advantages
that is provably composable at arbitrary orders
composition are an interesting open problem
advantage of the input refreshing asymmetry
that applies to synthetized VHDL code rather than abstract (e.g., glitch-free) circuit descriptions
Other PINI advantages
State-of-the-art tools (roughly)
abstract concrete direct comp.-based
Barthe et al.
(Eurocrypt 2015)
maskComp.
(ACM CCS 2016)
Tight Private Circuits
(Asiacrypt 2018)
REBECCA
(Eurocrypt 2018)
maskVerif
(ESORICS 2019)
fullVerif
(new)
State-of-the-art tools (roughly)
abstract concrete direct comp.-based
Barthe et al.
(Eurocrypt 2015)
maskComp.
(ACM CCS 2016)
Tight Private Circuits
(Asiacrypt 2018)
REBECCA
(Eurocrypt 2018)
maskVerif
(ESORICS 2019)
fullVerif
(new)
like the one by Eldib et al., or aiming at different, more specific, goals like the one of Arribas et al.)
State-of-the-art tools (roughly)
abstract concrete direct comp.-based
Barthe et al.
(Eurocrypt 2015)
maskComp.
(ACM CCS 2016)
Tight Private Circuits
(Asiacrypt 2018)
REBECCA
(Eurocrypt 2018)
maskVerif
(ESORICS 2019)
fullVerif
(new)
like the one by Eldib et al., or aiming at different, more specific, goals like the one of Arribas et al.)
HDL code and captures all physical defaults that can be naturally modeled with probes (i.e., transitions & glitches)
Hardware composition verification tool
Trivial composition makes it simple for the designer: "Just connect PINI gadgets together." Do you really want to write a tool to check that all gadgets are PINI ? for gadget in gadgets: assert gadget.is_pini(); // Uses maskVerif Done ?
A masked Verilog block cipher implementation
Code:
Parmeters:
15*6*3 = 270 parameter sets Complex code:
code
instances
Example LoC:
rinrfrs1_chunk[Nrndrfrs1_each-1+ii*Nrndrfrs1_each -: Nrndrfrs1_each] <= {rinrfrs1[(Nrndrfrs1_each/4)*4-1+(ii+8)*Nrndrfrs1_each -: (Nrndrfrs1_each/4)],{(Nrndrfrs1_each/4){1'b0}}, rinrfrs1[(Nrndrfrs1_each/4)*2- 1+(ii+8)*Nrndrfrs1_each -: (Nrndrfrs1_each/4)],{(Nrndrfrs1_each/4){1'b0}}};
Is this thing (glitch,transition)-robust t-probing secure ?
What could go wrong ?
Code written by a side-channel expert hardware designer. And no:
(Experiment might be biased.)
Tool workflow
Flexible: it is easy to implement
Tool workflow
Checking other strategies: 1 box change!
Source annotations
Source annotations: composite gadget
Source annotations: flatten (for the lazy)
http://perso.uclouvain.be/fstandae/