Optimizing Implementations of Linear Layers
Zejun Xiang, Xiangyong Zeng, Da Lin, Zhenzhen Bao, Shasha Zhang
- Nov. 09, 2020
Optimizing Implementations of Linear Layers Zejun Xiang, Xiangyong - - PowerPoint PPT Presentation
Optimizing Implementations of Linear Layers Zejun Xiang, Xiangyong Zeng, Da Lin, Zhenzhen Bao, Shasha Zhang Nov. 09, 2020 Lightweight Cryptography -Requirements -Primitives : SIMON SPECK Circuit size PRESENT, RECTANGLE
2019/4/13 湖北大学 7
CNOT gate 𝑦0 𝑦1 𝑦0 𝑦1 ⊕ 𝑦0
𝑙 ∈ 𝐺
2
𝑙 ∈ 𝐺
2
2 3
Pick the elementary
the most number of 1’s in the given matrix Tie break: the first one VS random Increase the number of 1’s –> infinite loop -> 1
𝑙,𝑚 𝑗 + 𝑔 𝑙,𝑚 𝑘
𝑙,𝑚 𝑗 + 𝑔 𝑙,𝑚 𝑘
𝑙,𝑚 𝑦 = ቐ
′ ↔ 𝑘𝑡 ′ ⋯ 𝐹(𝑗1 ′ ↔ 𝑘𝑡 ′)
R1 R2 R3 R7 R4 R6 R5 𝐹 𝑙 + 𝑗 𝐹 𝑙 + 𝑘 𝐹 𝑗 + 𝑘 = 𝐹 𝑗 + 𝑘 𝐹(𝑙 + 𝑗) 𝐹 𝑗 + 𝑙 𝐹 𝑙 + 𝑘 𝐹 𝑗 + 𝑘 = 𝐹 𝑙 + 𝑘 𝐹(𝑗 + 𝑙) 𝐹(𝑗 + 𝑙)𝐹 𝑘 + 𝑙 𝐹 𝑗 + 𝑘 = 𝐹 𝑗 + 𝑘 𝐹(𝑘 + 𝑙) 𝐹 𝑘 + 𝑙 𝐹 𝑗 + 𝑙 𝐹 𝑗 + 𝑘 = 𝐹 𝑗 + 𝑘 𝐹(𝑘 + 𝑙) 𝐹 𝑙 + 𝑘 𝐹 𝑙 + 𝑗 𝐹 𝑗 + 𝑘 = 𝐹 𝑗 + 𝑘 𝐹(𝑙 + 𝑗) 𝐹 𝑙 + 𝑘 𝐹 𝑗 + 𝑙 𝐹 𝑗 + 𝑘 = 𝐹 𝑗 + 𝑘 𝐹(𝑙 + 𝑘) 𝐹 𝑘 + 𝑗 𝐹 𝑗 + 𝑘 = 𝐹 𝑗 ↔ 𝑘 𝐹(𝑘 + 𝑗)
𝐹 𝑙 + 𝑗 𝐹 𝑙 + 𝑘 𝐹 𝑗 + 𝑘 = 𝐹 𝑗 + 𝑘 𝐹(𝑙 + 𝑗) Consider 𝐹 𝑙 + 𝑗 𝐹 𝑙 + 𝑘 𝐹 𝑗 + 𝑘 𝑦, where 𝑦 = 𝑦1, 𝑦2, … , 𝑦𝑜 . Only 𝑦𝑗, 𝑦𝑘 and 𝑦𝑙 are involved in the computation. 𝒚𝒋 𝒚𝒌 𝒚𝒍 𝑦𝑗 ⊕ 𝑦𝑘 𝑦𝑘 𝑦𝑙 𝑦𝑗 ⊕ 𝑦𝑘 𝑦𝑘 𝑦𝑙 ⊕ 𝑦𝑘 𝑦𝑗 ⊕ 𝑦𝑘 𝑦𝑘 𝑦𝑙 ⊕ 𝑦𝑗 𝒚𝒋 𝒚𝒌 𝒚𝒍 𝑦𝑗 𝑦𝑘 𝑦𝑙 ⊕ 𝑦𝑗 𝑦𝑗 ⊕ 𝑦𝑘 𝑦𝑘 𝑦𝑙 ⊕ 𝑦𝑗 equivalent
1 2 3 𝐹 𝑙 + 𝑚 𝐹 𝑗 + 𝑘 = 𝐹 𝑗 + 𝑘 𝐹(𝑙 + 𝑚) 𝐹 𝑗 + 𝑘 𝐹 𝑙 + 𝑘 = 𝐹 𝑙 + 𝑘 𝐹(𝑗 + 𝑘) 𝐹 𝑗 + 𝑘 𝐹 𝑗 + 𝑙 = 𝐹 𝑗 + 𝑙 𝐹(𝑗 + 𝑘) special cases
commutative reduction (R1)
cost = 3 cost = 4
A given matrix decomposition 𝐹(𝑗1 + 𝑘1) ⋮ ⋮ 𝐹(𝑗𝑡 + 𝑘𝑡) ⋮ ⋮ 𝐹(𝑗𝑢 + 𝑘𝑢) Commutable with Commutable with Match a reduction rule Conditions Identify possible reduction Reduction =
𝑁 decompose Pick a segment replace Reduce cost Equivalent decomposition
−1𝐹𝑜−1 −1 ⋯ 𝐹1 −1