mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 05:06:44 +01:00
rename to what it actually does
This commit is contained in:
@@ -21,16 +21,16 @@ where
|
||||
Self: GLWEBlindRotation<T, BE> + VecZnxAddScalarInplace + VecZnxNormalizeInplace<BE>,
|
||||
Scratch<BE>: ScratchTakeCore<BE>,
|
||||
{
|
||||
fn ggsw_blind_rotate_from_ggsw_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize
|
||||
fn ggsw_to_ggsw_blind_rotation_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize
|
||||
where
|
||||
R: GLWEInfos,
|
||||
K: GGSWInfos,
|
||||
{
|
||||
self.glwe_blind_rotation_tmp_bytes(res_infos, k_infos)
|
||||
self.glwe_to_glwe_blind_rotation_tmp_bytes(res_infos, k_infos)
|
||||
}
|
||||
|
||||
/// res <- a * X^{((k>>bit_rsh) % 2^bit_mask) << bit_lsh}.
|
||||
fn ggsw_blind_rotate_from_ggsw<R, A, K>(
|
||||
fn ggsw_to_ggsw_blind_rotation<R, A, K>(
|
||||
&self,
|
||||
res: &mut R,
|
||||
a: &A,
|
||||
@@ -53,7 +53,7 @@ where
|
||||
|
||||
for col in 0..(res.rank() + 1).into() {
|
||||
for row in 0..res.dnum().into() {
|
||||
self.glwe_blind_rotation(
|
||||
self.glwe_to_glwe_blind_rotation(
|
||||
&mut res.at_mut(row, col),
|
||||
&a.at(row, col),
|
||||
k,
|
||||
@@ -66,15 +66,15 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn ggsw_blind_rotate_from_scalar_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize
|
||||
fn scalar_to_ggsw_blind_rotation_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize
|
||||
where
|
||||
R: GLWEInfos,
|
||||
K: GGSWInfos,
|
||||
{
|
||||
self.glwe_blind_rotation_tmp_bytes(res_infos, k_infos) + GLWE::bytes_of_from_infos(res_infos)
|
||||
self.glwe_to_glwe_blind_rotation_tmp_bytes(res_infos, k_infos) + GLWE::bytes_of_from_infos(res_infos)
|
||||
}
|
||||
|
||||
fn ggsw_blind_rotate_from_scalar<R, S, K>(
|
||||
fn scalar_to_ggsw_blind_rotation<R, S, K>(
|
||||
&self,
|
||||
res: &mut R,
|
||||
test_vector: &S,
|
||||
@@ -109,7 +109,7 @@ where
|
||||
);
|
||||
self.vec_znx_normalize_inplace(base2k, tmp_glwe.data_mut(), col, scratch_1);
|
||||
|
||||
self.glwe_blind_rotation(
|
||||
self.glwe_to_glwe_blind_rotation(
|
||||
&mut res.at_mut(row, col),
|
||||
&tmp_glwe,
|
||||
k,
|
||||
@@ -135,7 +135,7 @@ where
|
||||
Self: GLWECopy + GLWERotate<BE> + Cmux<BE>,
|
||||
Scratch<BE>: ScratchTakeCore<BE>,
|
||||
{
|
||||
fn glwe_blind_rotation_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize
|
||||
fn glwe_to_glwe_blind_rotation_tmp_bytes<R, K>(&self, res_infos: &R, k_infos: &K) -> usize
|
||||
where
|
||||
R: GLWEInfos,
|
||||
K: GGSWInfos,
|
||||
@@ -144,7 +144,7 @@ where
|
||||
}
|
||||
|
||||
/// res <- a * X^{((k>>bit_rsh) % 2^bit_mask) << bit_lsh}.
|
||||
fn glwe_blind_rotation<R, A, K>(
|
||||
fn glwe_to_glwe_blind_rotation<R, A, K>(
|
||||
&self,
|
||||
res: &mut R,
|
||||
a: &A,
|
||||
@@ -1,12 +1,12 @@
|
||||
mod bdd_2w_to_1w;
|
||||
mod bdd_rotation;
|
||||
mod blind_rotation;
|
||||
mod ciphertexts;
|
||||
mod circuits;
|
||||
mod eval;
|
||||
mod key;
|
||||
|
||||
pub use bdd_2w_to_1w::*;
|
||||
pub use bdd_rotation::*;
|
||||
pub use blind_rotation::*;
|
||||
pub use ciphertexts::*;
|
||||
pub(crate) use circuits::*;
|
||||
pub(crate) use eval::*;
|
||||
|
||||
@@ -3,19 +3,19 @@ use poulpy_backend::FFT64Ref;
|
||||
use crate::tfhe::{
|
||||
bdd_arithmetic::tests::test_suite::{
|
||||
test_bdd_add, test_bdd_and, test_bdd_or, test_bdd_prepare, test_bdd_sll, test_bdd_slt, test_bdd_sltu, test_bdd_sra,
|
||||
test_bdd_srl, test_bdd_sub, test_bdd_xor, test_ggsw_blind_rotation, test_glwe_blind_rotation,
|
||||
test_bdd_srl, test_bdd_sub, test_bdd_xor, test_scalar_to_ggsw_blind_rotation, test_glwe_to_glwe_blind_rotation,
|
||||
},
|
||||
blind_rotation::CGGI,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn test_glwe_blind_rotation_fft64_ref() {
|
||||
test_glwe_blind_rotation::<FFT64Ref>()
|
||||
fn test_glwe_to_glwe_blind_rotation_fft64_ref() {
|
||||
test_glwe_to_glwe_blind_rotation::<FFT64Ref>()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ggsw_blind_rotation_fft64_ref() {
|
||||
test_ggsw_blind_rotation::<FFT64Ref>()
|
||||
fn test_scalar_to_ggsw_blind_rotation_fft64_ref() {
|
||||
test_scalar_to_ggsw_blind_rotation::<FFT64Ref>()
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -14,7 +14,7 @@ use rand::RngCore;
|
||||
|
||||
use crate::tfhe::bdd_arithmetic::{FheUintBlocksPrepared, GGSWBlindRotation};
|
||||
|
||||
pub fn test_ggsw_blind_rotation<BE: Backend>()
|
||||
pub fn test_scalar_to_ggsw_blind_rotation<BE: Backend>()
|
||||
where
|
||||
Module<BE>: ModuleNew<BE>
|
||||
+ GLWESecretPreparedFactory<BE>
|
||||
@@ -117,7 +117,7 @@ where
|
||||
// How many bits to take
|
||||
let bit_size: usize = (32 - bit_start).min(digit);
|
||||
|
||||
module.ggsw_blind_rotate_from_scalar(
|
||||
module.scalar_to_ggsw_blind_rotation(
|
||||
&mut res,
|
||||
&scalar,
|
||||
&k_enc_prep,
|
||||
|
||||
@@ -14,7 +14,7 @@ use rand::RngCore;
|
||||
|
||||
use crate::tfhe::bdd_arithmetic::{FheUintBlocksPrepared, GLWEBlindRotation};
|
||||
|
||||
pub fn test_glwe_blind_rotation<BE: Backend>()
|
||||
pub fn test_glwe_to_glwe_blind_rotation<BE: Backend>()
|
||||
where
|
||||
Module<BE>: ModuleNew<BE>
|
||||
+ GLWESecretPreparedFactory<BE>
|
||||
@@ -106,7 +106,7 @@ where
|
||||
// How many bits to take
|
||||
let bit_size: usize = (32 - bit_start).min(digit);
|
||||
|
||||
module.glwe_blind_rotation(
|
||||
module.glwe_to_glwe_blind_rotation(
|
||||
&mut res,
|
||||
&test_glwe,
|
||||
&k_enc_prep,
|
||||
|
||||
Reference in New Issue
Block a user