mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
18 lines
406 B
Rust
18 lines
406 B
Rust
use crate::elem::Elem;
|
|
use crate::parameters::Parameters;
|
|
use crate::plaintext::Plaintext;
|
|
|
|
pub struct Ciphertext(pub Elem);
|
|
|
|
impl Parameters {
|
|
pub fn new_ciphertext(&self, degree: usize, log_q: usize) -> Ciphertext {
|
|
Ciphertext(self.new_elem(degree, log_q))
|
|
}
|
|
}
|
|
|
|
impl Ciphertext {
|
|
pub fn as_plaintext(&self) -> Plaintext {
|
|
unsafe { Plaintext(std::ptr::read(&self.0)) }
|
|
}
|
|
}
|