pub unsafe trait DecryptionImpl<BE: Backend>: Backend {
// Required methods
fn glwe_decrypt_tmp_bytes<A>(module: &Module<BE>, infos: &A) -> usize
where A: GLWEInfos;
fn glwe_decrypt<R, P, S>(
module: &Module<BE>,
res: &R,
pt: &mut P,
sk: &S,
scratch: &mut ScratchArena<'_, BE>,
)
where R: GLWEToBackendRef<BE> + GLWEInfos,
P: GLWEToBackendMut<BE> + GLWEInfos + SetLWEInfos,
S: GLWESecretPreparedToBackendRef<BE> + GLWEInfos;
fn lwe_decrypt_tmp_bytes<A>(module: &Module<BE>, infos: &A) -> usize
where A: LWEInfos;
fn lwe_decrypt<R, P, S>(
module: &Module<BE>,
res: &R,
pt: &mut P,
sk: &S,
scratch: &mut ScratchArena<'_, BE>,
)
where R: LWEToBackendRef<BE> + LWEInfos,
P: LWEPlaintextToBackendMut<BE> + SetLWEInfos + LWEInfos,
S: LWESecretToBackendRef<BE> + LWEInfos;
fn glwe_tensor_decrypt<R: Data, P: Data, S0: Data, S1: Data>(
module: &Module<BE>,
res: &GLWETensor<R>,
pt: &mut GLWEPlaintext<P>,
sk: &GLWESecretPrepared<S0, BE>,
sk_tensor: &GLWESecretTensorPrepared<S1, BE>,
scratch: &mut ScratchArena<'_, BE>,
)
where GLWETensor<R>: GLWEToBackendRef<BE> + GLWEInfos,
GLWEPlaintext<P>: GLWEToBackendMut<BE> + GLWEInfos + SetLWEInfos,
GLWESecretPrepared<S0, BE>: GLWESecretPreparedToBackendRef<BE> + GLWEInfos,
GLWESecretTensorPrepared<S1, BE>: GLWESecretTensorPreparedToBackendRef<BE> + GLWEInfos;
fn glwe_tensor_decrypt_tmp_bytes<A>(module: &Module<BE>, infos: &A) -> usize
where A: GLWEInfos;
}Expand description
Backend-provided decryption operations.
§Safety
Implementations must interpret ciphertexts, plaintexts, and secrets according to their layout metadata, avoid out-of-bounds or aliased writes, and only use scratch space within the advertised temporary-size contracts.
Required Methods§
fn glwe_decrypt_tmp_bytes<A>(module: &Module<BE>, infos: &A) -> usizewhere
A: GLWEInfos,
fn glwe_decrypt<R, P, S>(
module: &Module<BE>,
res: &R,
pt: &mut P,
sk: &S,
scratch: &mut ScratchArena<'_, BE>,
)where
R: GLWEToBackendRef<BE> + GLWEInfos,
P: GLWEToBackendMut<BE> + GLWEInfos + SetLWEInfos,
S: GLWESecretPreparedToBackendRef<BE> + GLWEInfos,
fn lwe_decrypt_tmp_bytes<A>(module: &Module<BE>, infos: &A) -> usizewhere
A: LWEInfos,
fn lwe_decrypt<R, P, S>(
module: &Module<BE>,
res: &R,
pt: &mut P,
sk: &S,
scratch: &mut ScratchArena<'_, BE>,
)where
R: LWEToBackendRef<BE> + LWEInfos,
P: LWEPlaintextToBackendMut<BE> + SetLWEInfos + LWEInfos,
S: LWESecretToBackendRef<BE> + LWEInfos,
fn glwe_tensor_decrypt<R: Data, P: Data, S0: Data, S1: Data>(
module: &Module<BE>,
res: &GLWETensor<R>,
pt: &mut GLWEPlaintext<P>,
sk: &GLWESecretPrepared<S0, BE>,
sk_tensor: &GLWESecretTensorPrepared<S1, BE>,
scratch: &mut ScratchArena<'_, BE>,
)where
GLWETensor<R>: GLWEToBackendRef<BE> + GLWEInfos,
GLWEPlaintext<P>: GLWEToBackendMut<BE> + GLWEInfos + SetLWEInfos,
GLWESecretPrepared<S0, BE>: GLWESecretPreparedToBackendRef<BE> + GLWEInfos,
GLWESecretTensorPrepared<S1, BE>: GLWESecretTensorPreparedToBackendRef<BE> + GLWEInfos,
fn glwe_tensor_decrypt_tmp_bytes<A>(module: &Module<BE>, infos: &A) -> usizewhere
A: GLWEInfos,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.