10.09.2018
Practical CCA2-Secure and Masked Ring-LWE Implementation
Tobias Oder1, Tobias Schneider2, Thomas Pöppelmann3, Tim Güneysu1,4
1Ruhr-University Bochum, 2Université Catholique de Louvain, 3Infineon Technologies AG, 4DFKI
CHES 2018
Ring-LWE Implementation Tobias Oder 1 , Tobias Schneider 2 , Thomas - - PowerPoint PPT Presentation
Practical CCA2-Secure and Masked Ring-LWE Implementation Tobias Oder 1 , Tobias Schneider 2 , Thomas Pppelmann 3 , Tim Gneysu 1,4 1 Ruhr-University Bochum, 2 Universit Catholique de Louvain, 3 Infineon Technologies AG, 4 DFKI 10.09.2018
10.09.2018
Tobias Oder1, Tobias Schneider2, Thomas Pöppelmann3, Tim Güneysu1,4
1Ruhr-University Bochum, 2Université Catholique de Louvain, 3Infineon Technologies AG, 4DFKI
CHES 2018
2 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
3 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
– NewHope – LIMA – (Kyber) – …
4 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
– NewHope – LIMA – (Kyber) – … Previous work – A masked ring-LWE implementation. O. Reparaz, S. Sinha Roy,
– Additively homomorphic ring-LWE masking. O. Reparaz, S. Sinha Roy, R. de Clercq, F. Vercauteren, I. Verbauwhede. PQCrypto 2016
5 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
plaintext attackers (CPA)
attackers (CCA)
– Assumes negligible decryption error – Tweak by Targhi and Unruh for post-quantum security [TU16] – Expensive re-encryption in decryption
[TU16] E. E. Targhi and D. Unruh. Post-quantum security of the Fujisaki-Okamoto and OAEP
6 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
CCA2-secure Decryption
7 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
CCA2-secure Decryption
8 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
CCA2-secure Decryption
9 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
CCA2-secure Decryption
10 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
11 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
CCA2-secure first-order masked Ring-LWE implementation
12 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
CCA2-secure first-order masked Ring-LWE implementation
– Constrained computing capabilities/memory
13 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
CCA2-secure first-order masked Ring-LWE implementation
– Constrained computing capabilities/memory
timing attacks
– Boolean vs. arithmetic
14 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
Components to be masked in CCA2-secure Ring-LWE
– Polynomial multiplication
𝑏 𝑞 x x BS + + + 𝑛 𝑓𝑜𝑑𝑝𝑒𝑓 𝑑1 𝑑2 BS BS 𝑑1 𝑑2 𝑠
1
x + 𝑒𝑓𝑑𝑝𝑒𝑓 𝑛 Ring-LWE CPA Encryption Ring-LWE CPA Decryption
15 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
Components to be masked in CCA2-secure Ring-LWE
– Polynomial multiplication
[BDPVA10] Guido Bertoni, Joan Daemen, Michaël Peeters, and Gilles Van Assche. Building power analysis resistant implementations of Keccak. Second SHA-3 candidate conference, 2010
𝑏 𝑞 x x BS + + + 𝑛 𝑓𝑜𝑑𝑝𝑒𝑓 𝑑1 𝑑2 BS BS 𝑑1 𝑑2 𝑠
1
x + 𝑒𝑓𝑑𝑝𝑒𝑓 𝑛 Ring-LWE CPA Encryption Ring-LWE CPA Decryption
16 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
Components to be masked in CCA2-secure Ring-LWE
– Polynomial multiplication
[BDPVA10] Guido Bertoni, Joan Daemen, Michaël Peeters, and Gilles Van Assche. Building power analysis resistant implementations of Keccak. Second SHA-3 candidate conference, 2010
𝑏 𝑞 x x BS + + + 𝑛 𝑓𝑜𝑑𝑝𝑒𝑓 𝑑1 𝑑2 BS BS 𝑑1 𝑑2 𝑠
1
x + 𝑒𝑓𝑑𝑝𝑒𝑓 𝑛 Ring-LWE CPA Encryption Ring-LWE CPA Decryption
17 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
18 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
– Without masking: 𝑑𝑝𝑓𝑔𝑔 = 𝑐𝑗𝑢 ⋅ ⌊𝑟 2⌋
19 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
– Without masking: 𝑑𝑝𝑓𝑔𝑔 = 𝑐𝑗𝑢 ⋅ ⌊𝑟 2⌋ – With 𝑐𝑗𝑢′ ⊕ 𝑐𝑗𝑢′′ = 𝑐𝑗𝑢: 𝑑𝑝𝑓𝑔𝑔′ = 𝑐𝑗𝑢′ ⋅ ⌊𝑟 2⌋ 𝑑𝑝𝑓𝑔𝑔′′ = 𝑐𝑗𝑢′′ ⋅ 𝑟 2
20 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
– Without masking: 𝑑𝑝𝑓𝑔𝑔 = 𝑐𝑗𝑢 ⋅ ⌊𝑟 2⌋ – With 𝑐𝑗𝑢′ ⊕ 𝑐𝑗𝑢′′ = 𝑐𝑗𝑢: 𝑑𝑝𝑓𝑔𝑔′ = 𝑐𝑗𝑢′ ⋅ ⌊𝑟 2⌋ 𝑑𝑝𝑓𝑔𝑔′′ = 𝑐𝑗𝑢′′ ⋅ 𝑟 2
𝑟 2 + 𝑟 2 ≠ 𝑟
Problem: Result is off by one if 𝑐𝑗𝑢′ = 1 and 𝑐𝑗𝑢′′ = 1
21 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
Solution: Add 𝑐𝑗𝑢′ ⋅ 𝑐𝑗𝑢′′ to the result
𝑐𝑗𝑢′ 1 + 𝑐𝑗𝑢′ 2 ⋅ (𝑐𝑗𝑢′′(1) + 𝑐𝑗𝑢′′ 2 ) = 𝑐𝑗𝑢′(1) ⋅ 𝑐𝑗𝑢′′ 1 + 𝑐𝑗𝑢′ 1 ⋅ 𝑐𝑗𝑢′′ 2 + 𝑐𝑗𝑢′(2) ⋅ 𝑐𝑗𝑢′′ 1 + 𝑐𝑗𝑢′(2) ⋅ 𝑐𝑗𝑢′′ 2
22 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
23 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
Input: Coefficient ∈ [0, 𝑟 − 1] Output: Decoded bit Idea:
coefficients
Boolean conversion
24 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
Input: Coefficient ∈ [0, 𝑟 − 1] Output: Decoded bit Idea:
coefficients
Boolean conversion
25 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
Input: Coefficient ∈ [0, 𝑟 − 1] Output: Decoded bit Idea:
coefficients
Boolean conversion
26 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
Input: Coefficient ∈ [0, 𝑟 − 1] Output: Decoded bit Idea:
coefficients
Boolean conversion
27 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
28 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
σ𝑗=0
7
(𝑐𝑗𝑢′ 𝑗 ⊕ 𝑐𝑗𝑢′′ 𝑗 ) = σ𝑗=0
7
𝑐𝑗𝑢′ 𝑗 + 𝑐𝑗𝑢′′ 𝑗 − 2𝑐𝑗𝑢′(𝑗)𝑐𝑗𝑢′′(𝑗)
29 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
30 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
T-test evaluation of the decoding (example)
31 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
32 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
33 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
34 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
35 CCA2-Secure and Masked Ring-LWE | Tobias Oder | Ruhr-University Bochum | 10.09.2018
covers CCA2-security with first-order proof