kazim yumbul serdar süer erdem *erkay...

24
Kazim Yumbul Gebze Institute of Technology Gebze, Kocaeli, 41400 Turkey Email: [email protected] Serdar Süer Erdem Gebze Institute of Technology Gebze, Kocaeli, 41400 Turkey Email: ser [email protected] *Erkay Savaş Sabanci University Tuzla Istanbul, 34956 Turkey Email: [email protected] 1 FDTC 2011, 27 September, Nara Japan

Upload: others

Post on 01-Mar-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Kazim YumbulGebze Institute of TechnologyGebze, Kocaeli, 41400 TurkeyEmail: [email protected]

Serdar Süer ErdemGebze Institute of TechnologyGebze, Kocaeli, 41400 TurkeyEmail: ser [email protected]

*Erkay SavaşSabanci University

Tuzla Istanbul, 34956 TurkeyEmail: [email protected]

1FDTC 2011, 27 September, Nara Japan

Relatore
Note di presentazione
I have 25 minutes; but should try to finish it 20 minutes. Need to decrease the number of slides to under 20.
Page 2: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

OUTLINEIntroductionSummary of ContributionNon-linear Residue Codes for Error DetectionAdversarial ModelAttacks on Residue CodesError Detection Strategy ArchitectureImplementation ResultsConclusion and Future Work

2FDTC 2011, 27 September, Nara Japan

Page 3: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

INTRODUCTIONAdversary having physical access to cryptographic device can introduce errors during the calculationsFaulty calculations compromise of secret keysRemedy: Equip the device with error detectioncapabilityConventional error-detection codes may not be sufficient against sophisticated attackersKarpovsky and Taubin proposed non-linear codes

FDTC 2011, 27 September, Nara Japan 3

Page 4: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

CONTRIBUTIONOur solution also based on non-linear codes

Specifically quadratic residue codesOur contribution:

Investigation of the security of quadratic residue codes against a new type of adversarial modelProposal of a new residue codes using two moduli Integration of the quadratic residue codes into the datapath of an embedded processorInvestigation of the overhead cost of the integration (chip space, time complexity)

4FDTC 2011, 27 September, Nara Japan

Relatore
Note di presentazione
In this work, we propose a new category of error detection codes, called quadratic dual residue codes, to protect the data path of a microprocessor core against fault attacks during cryptographic computation. In the adopted error detection strategy, two robust execution units (i.e. multiplier and adder ) integrated into a microprocessor are employed. We choose a reconfigurable embedded processor core, Xtens a LX3 [17 ] by Tensilica. The robus t execution units ar e developed using Tensilica Instruction Extens ion Language (TI E), which is a Verilog-like language. Using synthesis tools, we obtain the space and time complexities for the ASIC and the FPGA implementations of the enhanced processor core with error detection. Using robust addition and multiplication instructions , a C implementation of the Montgomery modular multiplication algorithm is developed.
Page 5: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Residue Codes for Error Detection

Non-linear residue codes

FDTC 2011, 27 September, Nara Japan 5

Quadratic residue codes

Dual residue codes

w = wp ||wq , wp = fp (x) mod p and wq = fq (x) mod q

C = {(x, w) | x ∈

Z2k , w = f(x) mod p ∈

Fp }

C = {(x, w) | x ∈

Z2k , w = x2 mod p ∈

Fp }

C = {(x, w) | x ∈

Z2k , w = fp (x) mod p || fq (x) mod q }

Page 6: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Undetected Errors

FDTC 2011, 27 September, Nara Japan 6

Let ex and ew denote errors in the data x and parity w, respectivelyUndetected errors

The probability that this error remains undetected (error masking probability)

f(x + ex mod 2k) mod p = w + ew mod 2r}

( ){ }C

CewexxeeQeQ wx

wx

∈++==

,),()(

Page 7: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Adversarial ModelAssumptions on the (powerful) adversary

cannot read the bits in the data path; i.e. x and w are unknown.can flip bits of the data x and the parity w to generate undetectable errors

Example: simple residue codew = x mod p, where p = 2r -1 and r < kA data word x = (xk-1,…, xr , xr-1,…x1, x0)Attack: xm = (xk-1,…, xr’, xr-1,…x1, x0’)If x = (xk-1,…, 0, xr-1,…x1, 1) xm = x + p w = xm mod p

7FDTC 2011, 27 September, Nara Japan

Relatore
Note di presentazione
We assume a relatively powerful adversary that can flip any subset of bits in the data path at will, where the cryptographic operations are performed.
Page 8: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Attacking Quadratic Residue CodesSecurity depends on the choice of the modulusExample:

p = 232-5 (suitable for protecting computer words )p = 11111111111111111111111111111011Data words of the form x = (x31,…, x4, x3,0,x1, x0) Attack: xm = (x31’,…, x4’, x3’,0,x1’, x0’)xm = p-x w = x2 mod p = (p-x) 2 mod p Success probability: 50%

A better modulus may result in poor implementation

p = 0xFB01CDD9FDTC 2011, 27 September, Nara Japan 8

Page 9: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Dual Residue CodesBasic idea is to use two moduli, p and qParity

w = fp(x) mod p || wq= fq(x) mod q

Attacking Example:wp = x mod 219-1 and wq = x2 mod 213-1x = (x31,…, 0, x12,…,x1, 1) xm = x+q wq = xm mod qwp ≠ xm mod p = x mod p + 213-1 mod pIf wp =(wp,18,…, 0,wp,12,…, wp,1,1)Success rate is 1/16 if we are able to flip the bits x13, x0, wp,13, and wp,0.

9FDTC 2011, 27 September, Nara Japan

Relatore
Note di presentazione
The two functions fp(x) and fq(x) represent simple arithmetic operations, linear or nonlinear
Page 10: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Quadratic Dual Residue CodesDefinition

wp = x2 mod p and wq = x2 mod q.Due to Chinese Remainder Theorem

there are four data words x1, x2, x3, x4 that have the same paritysp = x mod p and sq = x mod qx1 ≡ (sp⋅ Np ⋅ Mp + sq⋅ Nq ⋅ Mq ) mod nx2 ≡ (-sp⋅ Np ⋅ Mp + sq⋅ Nq ⋅ Mq ) mod nx3 ≡ (sp⋅ Np ⋅ Mp - sq⋅ Nq ⋅ Mq ) mod nx4 ≡ (-sp⋅ Np ⋅ Mp - sq⋅ Nq ⋅ Mq ) mod n

FDTC 2011, 27 September, Nara Japan 10

Page 11: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Quadratic Dual Residue CodesAttack scenarios

x1 ≡ - x4 mod np = 219-1 and q = 213-1n = p ⋅ q = 11111111111101111110000000000001 difficult

x1 ≡ x2 mod qx1 ≡ - x2 mod pAdding a multiple of n to x.Since n < 232-1 it is possible, however difficult and unlikelyChoose k = 31 some performance implications

FDTC 2011, 27 September, Nara Japan 11

Page 12: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Robust Functional UnitInput parities are known

Since they are output of other robust functional unit

FDTC 2011, 27 September, Nara Japan 14

Page 13: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Robust AdderPredicted parity

FDTC 2011, 27 September, Nara Japan 15

Calculated parity

Check

Page 14: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Robust MultiplierPredicted parity

FDTC 2011, 27 September, Nara Japan 16

Calculated parity

Check

Page 15: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

IntegrationPipeline Integration of the Proposed Robust Functional Units

FDTC 2011, 27 September, Nara Japan 17

Adder

Multiplier

Page 16: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Data HazardsOccasional pipeline stalls

Due to data dependencies and long lasting robust operations Reordering can eliminate most.

FDTC 2011, 27 September, Nara Japan 18

Page 17: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Processor Configurations

Configuration 0:32-bit Xtensa LX3 microprocessorA simple embedded processor without robust units

Configuration 1:p = 232 – 5 (wp = x2 mod p) and k = 32Unsafe against the proposed adversary model

Configuration 2:p = 231 – 1 (wp = x2 mod p) and k = 31Unsafe against the proposed adversary modelEasier to implement in hardware

19FDTC 2011, 27 September, Nara Japan

Page 18: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Processor ConfigurationsConfiguration 3

wp = x2 mod p, wq = x mod q

p = 219 – 1 and q = 213 – 1 (k = 32)

Unsafe against the proposed adversary model

Configuration 4wp = x2 mod p, wq = x mod q

p = 219 – 1 and q = 213 – 1 (k = 31)

Unsafe against the proposed adversary model

FDTC 2011, 27 September, Nara Japan 20

Page 19: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Processor ConfigurationsConfiguration 5

wp = x2 mod p, wq = x2 mod qp = 219 – 1 and q= 213 – 1 (k = 32)Good protection against the proposed adversary model

Configuration 6wp = x2 mod p, wq = x2 mod qp = 219 – 1 and q= 213 – 1 (k = 31)Good protection against the proposed adversary model

FDTC 2011, 27 September, Nara Japan 21

Page 20: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Implementation Results

22FDTC 2011, 27 September, Nara Japan

~ 50% increase in ASIC area

Lower clock count due to optimized functional units

Page 21: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Implementation Results

23FDTC 2011, 27 September, Nara Japan

moreDSP units

Less than 50% increase

Negligible decrease in clock frequency

Some decrease in clock frequency

Page 22: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Conclusion and Future Work Certain residue codes are shown to be insecure in the adopted adversarial model A new class of error detection codes is proposedRobust functional units utilizing residue codes are designed and implemented in an embedded processorImplementation results of the new processor core for both ASIC and FPGA are reported

24FDTC 2011, 27 September, Nara Japan

Page 23: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

Conclusion and Future Work The results show that it is possible to incorporate powerful error detection circuitry even into an embedded processor core if low to moderate increases in area and time are tolerable.The adopted error detection strategy benefits many cryptographic applications that uses basic arithmetic operations.Need for more analysis of the residue codes

We already obtained new results

25FDTC 2011, 27 September, Nara Japan

Page 24: Kazim Yumbul Serdar Süer Erdem *Erkay Savaşconferenze.dei.polimi.it/FDTC11/shared/FDTC-2011-session-3-1.pdfKazim Yumbul. Gebze Institute of Technology. Gebze, Kocaeli, 41400 Turkey

QUESTIONS ?

THANK YOU

26FDTC 2011, 27 September, Nara Japan