Skip to content

Commit 6e0f86d

Browse files
tmontaiguIceTDrinker
authored andcommitted
fix: rotations of 1 blocks of 4_4
1 parent 81223b0 commit 6e0f86d

File tree

1 file changed

+3
-2
lines changed
  • tfhe/src/integer/server_key/radix_parallel

1 file changed

+3
-2
lines changed

tfhe/src/integer/server_key/radix_parallel/shift.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,13 @@ impl ServerKey {
391391
}
392392
BarrelShifterOperation::LeftRotate => {
393393
let shifted = (input << shift_within_block) % self.message_modulus().0;
394-
let wrapped = input >> (shift_within_block);
394+
let wrapped = input >> (message_bits_per_block - shift_within_block);
395395
shifted | wrapped
396396
}
397397
BarrelShifterOperation::RightRotate => {
398398
let shifted = input >> shift_within_block;
399-
let wrapped = (input << shift_within_block) % self.message_modulus().0;
399+
let wrapped = (input << (message_bits_per_block - shift_within_block))
400+
% self.message_modulus().0;
400401
wrapped | shifted
401402
}
402403
BarrelShifterOperation::RightShift => {

0 commit comments

Comments
 (0)