arnaucube
arnaucube/poulpyPublic Self-hosted repository
poulpy/core/src/keyswitch.rs
core/src/keyswitch.rsRaw
 1use base2k::{FFT64, Module, Scratch};
 2
 3pub trait KeySwitchScratchSpace {
 4    fn keyswitch_scratch_space(module: &Module<FFT64>, res_size: usize, lhs: usize, rhs: usize) -> usize;
 5}
 6
 7pub trait KeySwitch<DataLhs, DataRhs> {
 8    type Lhs;
 9    type Rhs;
10    fn keyswitch(&mut self, module: &Module<FFT64>, lhs: &Self::Lhs, rhs: &Self::Rhs, scratch: &mut Scratch);
11}
12
13pub trait KeySwitchInplaceScratchSpace {
14    fn keyswitch_inplace_scratch_space(module: &Module<FFT64>, res_size: usize, rhs: usize) -> usize;
15}
16
17pub trait KeySwitchInplace<DataRhs> {
18    type Rhs;
19    fn keyswitch_inplace(&mut self, module: &Module<FFT64>, rhs: &Self::Rhs, scratch: &mut Scratch);
20}