IdentityKeSwitching((𝐚,b),𝐊𝐒)
b̃=b
for i from 0 to n
ãᵢ = 0
prec_offset = 1 << (32 - (1 + basebit * t)) //四捨五入のため
for i from 0 to k-1
for j from 0 to N-1
āᵢⱼ = aᵢⱼ+prec_offset //四捨五入
for m from 0 to t-1
o = (āᵢⱼ >> (32 - (m+1)⋅basebit))&(2ᵇᵃˢᵉᵇⁱᵗ - 1) //unicodeだとâᵢⱼₘを下付きにできないので
if k != 0
(𝐚̃,b̃) -= KSᵢⱼₘₒ
return (𝐚̃,b̃)