mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
wip
This commit is contained in:
@@ -6,20 +6,20 @@ use poulpy_hal::{
|
||||
layouts::{Backend, DataMut, DataRef, DataViewMut, Module, Scratch},
|
||||
};
|
||||
|
||||
use crate::layouts::{GLWECiphertext, GLWEInfos, GLWEPlaintext, LWEInfos, prepared::GLWESecretPrepared};
|
||||
use crate::layouts::{GLWE, GLWEInfos, GLWEPlaintext, LWEInfos, prepared::GLWESecretPrepared};
|
||||
|
||||
impl GLWECiphertext<Vec<u8>> {
|
||||
impl GLWE<Vec<u8>> {
|
||||
pub fn decrypt_scratch_space<B: Backend, A>(module: &Module<B>, infos: &A) -> usize
|
||||
where
|
||||
A: GLWEInfos,
|
||||
Module<B>: VecZnxDftAllocBytes + VecZnxNormalizeTmpBytes + VecZnxDftAllocBytes,
|
||||
{
|
||||
let size: usize = infos.size();
|
||||
(module.vec_znx_normalize_tmp_bytes() | module.vec_znx_dft_alloc_bytes(1, size)) + module.vec_znx_dft_alloc_bytes(1, size)
|
||||
(module.vec_znx_normalize_tmp_bytes() | module.vec_znx_dft_bytes_of(1, size)) + module.vec_znx_dft_bytes_of(1, size)
|
||||
}
|
||||
}
|
||||
|
||||
impl<DataSelf: DataRef> GLWECiphertext<DataSelf> {
|
||||
impl<DataSelf: DataRef> GLWE<DataSelf> {
|
||||
pub fn decrypt<DataPt: DataMut, DataSk: DataRef, B: Backend>(
|
||||
&self,
|
||||
module: &Module<B>,
|
||||
|
||||
@@ -4,9 +4,9 @@ use poulpy_hal::{
|
||||
oep::{ScratchOwnedAllocImpl, ScratchOwnedBorrowImpl},
|
||||
};
|
||||
|
||||
use crate::layouts::{LWECiphertext, LWEInfos, LWEPlaintext, LWESecret};
|
||||
use crate::layouts::{LWE, LWEInfos, LWEPlaintext, LWESecret};
|
||||
|
||||
impl<DataSelf> LWECiphertext<DataSelf>
|
||||
impl<DataSelf> LWE<DataSelf>
|
||||
where
|
||||
DataSelf: DataRef,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user