Skip to content

Commit d0cc3f6

Browse files
committed
fix(integer): fix StaticUnsignedBigInt cast into u128
1 parent f9268b8 commit d0cc3f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tfhe/src/integer/bigint/static_unsigned.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ impl<const N: usize> CastFrom<u128> for StaticUnsignedBigInt<N> {
418418

419419
impl<const N: usize> CastFrom<StaticUnsignedBigInt<N>> for u128 {
420420
fn cast_from(input: StaticUnsignedBigInt<N>) -> Self {
421-
input.0[0] as Self | input.0.get(1).copied().unwrap_or(0) as Self
421+
input.0[0] as Self | ((input.0.get(1).copied().unwrap_or(0) as Self) << 64)
422422
}
423423
}
424424

0 commit comments

Comments
 (0)