We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 81223b0 commit 6e0f86dCopy full SHA for 6e0f86d
tfhe/src/integer/server_key/radix_parallel/shift.rs
@@ -391,12 +391,13 @@ impl ServerKey {
391
}
392
BarrelShifterOperation::LeftRotate => {
393
let shifted = (input << shift_within_block) % self.message_modulus().0;
394
- let wrapped = input >> (shift_within_block);
+ let wrapped = input >> (message_bits_per_block - shift_within_block);
395
shifted | wrapped
396
397
BarrelShifterOperation::RightRotate => {
398
let shifted = input >> shift_within_block;
399
- let wrapped = (input << shift_within_block) % self.message_modulus().0;
+ let wrapped = (input << (message_bits_per_block - shift_within_block))
400
+ % self.message_modulus().0;
401
wrapped | shifted
402
403
BarrelShifterOperation::RightShift => {
0 commit comments