mirror of
https://github.com/arnaucube/fhe-study.git
synced 2026-01-24 04:33:52 +01:00
add ciphertext-by-const (plaintext) addition & mult
This commit is contained in:
@@ -85,6 +85,11 @@ impl<const Q: u64, const N: usize> PR<Q, N> {
|
||||
evals: None,
|
||||
})
|
||||
}
|
||||
// Warning: this method assumes Q < P
|
||||
pub fn remodule<const P: u64>(&self) -> PR<P, N> {
|
||||
assert!(Q < P);
|
||||
PR::<P, N>::from_vec_u64(self.coeffs().iter().map(|m_i| m_i.0).collect())
|
||||
}
|
||||
|
||||
// TODO review if needed, or if with this interface
|
||||
pub fn mul_by_matrix(&self, m: &Vec<Vec<Zq<Q>>>) -> Result<Vec<Zq<Q>>> {
|
||||
|
||||
Reference in New Issue
Block a user