amend rlwe_encrypt example and minor changes at multiple places

This commit is contained in:
Janmajaya Mall
2025-05-04 19:46:22 +05:30
parent b82a1ca1b4
commit bd105497fd
11 changed files with 267 additions and 414 deletions

View File

@@ -217,7 +217,7 @@ pub type VecZnxMut<'a> = VecZnx<&'a mut [u8]>;
pub type VecZnxRef<'a> = VecZnx<&'a [u8]>;
impl VecZnx<Vec<u8>> {
pub(crate) fn to_mut(&mut self) -> VecZnx<&mut [u8]> {
pub fn to_mut(&mut self) -> VecZnx<&mut [u8]> {
VecZnx {
data: self.data.as_mut_slice(),
n: self.n,
@@ -226,7 +226,7 @@ impl VecZnx<Vec<u8>> {
}
}
pub(crate) fn to_ref(&self) -> VecZnx<&[u8]> {
pub fn to_ref(&self) -> VecZnx<&[u8]> {
VecZnx {
data: self.data.as_slice(),
n: self.n,
@@ -235,3 +235,14 @@ impl VecZnx<Vec<u8>> {
}
}
}
impl VecZnx<&mut [u8]> {
pub fn to_ref(&self) -> VecZnx<&[u8]> {
VecZnx {
data: &self.data,
n: self.n,
cols: self.cols,
size: self.size,
}
}
}