Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion logproof/src/linear_relation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ mod test {
assert_eq!(bit_vec.len(), 9 * vals.len());

let sign_extend = |mut x: u16| {
let sign = (x & 0x1 << 8) >> 8;
let sign = (x & (0x1 << 8)) >> 8;

for i in 9..16 {
x |= sign << i;
Expand Down
2 changes: 1 addition & 1 deletion sunscreen/src/types/bfv/fractional.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ impl<const INT_BITS: usize> TryIntoPlaintext for Fractional<INT_BITS> {
}

for i in 0..f64::MANTISSA_DIGITS {
let bit_value = (mantissa & 0x1 << i) >> i;
let bit_value = (mantissa & (0x1 << i)) >> i;
let bit_power = power - (f64::MANTISSA_DIGITS - i - 1) as i64;

let coeff_index = if bit_power >= 0 {
Expand Down
2 changes: 1 addition & 1 deletion sunscreen/src/types/bfv/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl TryIntoPlaintext for Signed {
seal_plaintext.resize(sig_bits);

for i in 0..sig_bits {
let bit_value = (signed_val & 0x1 << i) >> i;
let bit_value = (signed_val & (0x1 << i)) >> i;

let coeff_value = if self.val < 0 {
bit_value * (params.plain_modulus - bit_value)
Expand Down
2 changes: 1 addition & 1 deletion sunscreen/src/types/zkp/bfv_plaintext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ mod tests {
let mut signed_encoding = [0; <Signed as LinkWithZkp>::DEGREE_BOUND];
let abs_val = val.unsigned_abs();
for (i, c) in signed_encoding.iter_mut().take(64).enumerate() {
let bit = (abs_val & 0x1 << i) >> i;
let bit = (abs_val & (0x1 << i)) >> i;
*c = if val.is_negative() {
bit * (plain_modulus - bit)
} else {
Expand Down
3 changes: 3 additions & 0 deletions sunscreen_tfhe/src/dst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,12 @@ macro_rules! dst_iter {

pub type NoWrapper<T> = T;

/// Describes how large an entity will be for the given parameters.
pub trait OverlaySize {
/// The inputs that determine this entity's size
type Inputs: Copy + Clone;

/// Get the size of the entity.
fn size(t: Self::Inputs) -> usize;
}

Expand Down
1 change: 1 addition & 0 deletions sunscreen_tfhe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#[macro_use]
mod dst;
pub use dst::OverlaySize;

/// Methods for iterating over data structures.
pub(crate) mod iteration;
Expand Down