From 8a9559c4d12d57782d705a4591218d001841295b Mon Sep 17 00:00:00 2001 From: Arthur Meyre Date: Wed, 31 Jan 2024 16:45:55 +0100 Subject: [PATCH] chore(doc): fix modulus struct docstrings in shortint - it stated it represented a number of bits while it represents the actual modulus --- tfhe/src/shortint/parameters/mod.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tfhe/src/shortint/parameters/mod.rs b/tfhe/src/shortint/parameters/mod.rs index 32b0bd4714..15a8c75f59 100644 --- a/tfhe/src/shortint/parameters/mod.rs +++ b/tfhe/src/shortint/parameters/mod.rs @@ -30,11 +30,22 @@ pub use parameters_wopbs::WopbsParameters; use super::ciphertext::{Degree, NoiseLevel}; use super::PBSOrder; -/// The number of bits on which the message will be encoded. +/// The modulus of the message space. For a given plaintext $p$ we have the message $m$ defined as +/// $m = p\bmod{MessageModulus}$ and so $0 <= m < MessageModulus$. +/// +/// # Note +/// +/// The total plaintext modulus is given by $MessageModulus \times CarryModulus$ #[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)] pub struct MessageModulus(pub usize); -/// The number of bits on which the carry will be encoded. +/// The modulus of the carry space. For a given plaintext $p$ we have the carry $c$ defined as +/// $c = \frac{p}{MessageModulus}$ and so $0 <= c < CarryModulus$ as the total plaintext modulus is +/// given by $MessageModulus \times CarryModulus$ +/// +/// # Note +/// +/// The total plaintext modulus is given by $MessageModulus \times CarryModulus$ #[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)] pub struct CarryModulus(pub usize);