From 415e998cd97c7401f280519a0df58a437f0f14b2 Mon Sep 17 00:00:00 2001 From: nindanaoto Date: Wed, 14 Aug 2024 04:54:19 +0000 Subject: [PATCH] fix catiks --- include/keyswitch.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/keyswitch.hpp b/include/keyswitch.hpp index 55ffaae..fd5c921 100644 --- a/include/keyswitch.hpp +++ b/include/keyswitch.hpp @@ -112,13 +112,13 @@ void CatIdentityKeySwitch( for (int j = 0; j < P::t; j++) { for (int cat = 0; cat < numcat; cat++) { const int32_t aij = - ((aibar >> (std::numeric_limits::digits - + ((aibarcat[cat] >> (std::numeric_limits::digits - (j + 1) * P::basebit)) & mask)-halfbase; if (aij > 0) for (int k = 0; k <= P::targetP::k * P::targetP::n; k++) res[cat][k] -= ksk[i][j][aij - 1][k]; - if (aij < 0) + else if (aij < 0) for (int k = 0; k <= P::targetP::k * P::targetP::n; k++) res[cat][k] += ksk[i][j][-aij - 1][k]; }