mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-09 22:57:59 -05:00
fix(shortint): use saturating_sub to get degree from message modulus
This commit is contained in:
committed by
Nicolas Sarlin
parent
238f7d51f6
commit
50b76817c9
@@ -113,7 +113,7 @@ pub struct MessageModulus(pub u64);
|
||||
|
||||
impl MessageModulus {
|
||||
pub fn corresponding_max_degree(&self) -> MaxDegree {
|
||||
MaxDegree::new(self.0 - 1)
|
||||
MaxDegree::new(self.0.saturating_sub(1))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user