Skip to main content
. 2022 Oct 18;24(10):1489. doi: 10.3390/e24101489
Algorithm 6 Our Message Recovery Attack
1 Preprocessing Stage
2  for j = 0 to 7 do
//collect traces for template construction
3   for k = 0 to j + 1 do
4    T(0,j)k= IND-CCA KEM Decapsulation(CT(0,j)k)
5   end for
//leakage detection
6   Wj = TVLA(T(0,1)0,T(0,1)1)
//choose PoIs
7   p(0, j) = NICV(Wj, T(0,j)0,…, T(0,j)j+1)
//template construction
8   for k = 0 to j + 1 do
9    T(0,j)k=T(0,j)k(p(0, j))
10    rPk= mean(T(0,j)k)
11   end for
12 end for

13 Template Matching Stage
14 for i = 0 to n -1 do
//construct special ciphertexts
15  cti = Construct(ct, i)
//collect traces for attack
16  tri = IND-CCA KEM Decapsulation(cti)
17  for j = 0 to 7 do
//reduced traces
18   tr(i, j)′ = tri(p(0, j))
19   for k = 0 to j + 1 do
20    Γ(i,j)k= SOSD(tr(i, j)′, rPk)
21   end for
//calculate the HW of intermediate value
22   HW(m[i, j]) = min(Γ(i,j)k)
//recover the message byte
23   m[i]j = F(HW(m[i, j]), HW(m[i, j] − 1))
24  end for
25 end for