use poulpy_hal::{ layouts::{Backend, DataMut, Scratch}, source::Source, }; use poulpy_core::{ GetDistribution, ScratchTakeCore, layouts::{GGSWInfos, GLWEInfos, GLWESecretPreparedToRef, LWEInfos, LWESecretToRef}, }; use crate::tfhe::blind_rotation::{BlindRotationAlgo, BlindRotationKey}; pub trait BlindRotationKeyEncryptSk { fn blind_rotation_key_encrypt_sk_tmp_bytes(&self, infos: &A) -> usize where A: GGSWInfos; #[allow(clippy::too_many_arguments)] fn blind_rotation_key_encrypt_sk( &self, res: &mut BlindRotationKey, sk_glwe: &S0, sk_lwe: &S1, source_xa: &mut Source, source_xe: &mut Source, scratch: &mut Scratch, ) where D: DataMut, S0: GLWESecretPreparedToRef + GLWEInfos, S1: LWESecretToRef + LWEInfos + GetDistribution; } impl BlindRotationKey { pub fn encrypt_sk( &mut self, module: &M, sk_glwe: &S0, sk_lwe: &S1, source_xa: &mut Source, source_xe: &mut Source, scratch: &mut Scratch, ) where S0: GLWESecretPreparedToRef + GLWEInfos, S1: LWESecretToRef + LWEInfos + GetDistribution, Scratch: ScratchTakeCore, M: BlindRotationKeyEncryptSk, { module.blind_rotation_key_encrypt_sk(self, sk_glwe, sk_lwe, source_xa, source_xe, scratch); } } impl BlindRotationKey, BRA> { pub fn encrypt_sk_tmp_bytes(module: &M, infos: &A) -> usize where A: GGSWInfos, M: BlindRotationKeyEncryptSk, { module.blind_rotation_key_encrypt_sk_tmp_bytes(infos) } }