Skip to content
Open
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
19 changes: 18 additions & 1 deletion src/shortint/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod enc_dec;
pub(crate) mod enc_dec;
mod ops;

pub type FheUint8 = enc_dec::FheUint8<Vec<u64>>;
Expand Down Expand Up @@ -290,5 +290,22 @@ mod frontend {
self.mux(other, &self_lt)
}
}

impl std::ops::Not for &FheUint8 {
type Output = FheUint8;
fn not(self) -> Self::Output {
BoolEvaluator::with_local(|e| FheUint8 {
data: self.data().iter().map(|b| e.not(b)).collect(),
})
}
}

impl std::ops::Not for FheUint8 {
type Output = FheUint8;
fn not(self) -> Self::Output {
// This just calls the impl above with 0 overhead.
!(&self)
}
}
}
}