Skip to content

Commit

Permalink
fix: rotations of 1 blocks of 4_4
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontaigu committed Feb 14, 2025
1 parent 1b7f7a5 commit 42e9b60
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tfhe/src/integer/server_key/radix_parallel/shift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,13 @@ impl ServerKey {
}
BarrelShifterOperation::LeftRotate => {
let shifted = (input << shift_within_block) % self.message_modulus().0;
let wrapped = input >> (shift_within_block);
let wrapped = input >> (message_bits_per_block - shift_within_block);
shifted | wrapped
}
BarrelShifterOperation::RightRotate => {
let shifted = input >> shift_within_block;
let wrapped = (input << shift_within_block) % self.message_modulus().0;
let wrapped = (input << (message_bits_per_block - shift_within_block))
% self.message_modulus().0;
wrapped | shifted
}
BarrelShifterOperation::RightShift => {
Expand Down

0 comments on commit 42e9b60

Please sign in to comment.