mirror of
https://github.com/arnaucube/poulpy.git
synced 2026-02-10 13:16:44 +01:00
wip
This commit is contained in:
@@ -25,7 +25,7 @@ impl GLWESwitchingKeyCompressed<Vec<u8>> {
|
||||
{
|
||||
(GGLWE::encrypt_sk_scratch_space(module, infos) | ScalarZnx::alloc_bytes(module.n(), 1))
|
||||
+ ScalarZnx::alloc_bytes(module.n(), infos.rank_in().into())
|
||||
+ GLWESecretPrepared::alloc_bytes_with(module, infos.rank_out())
|
||||
+ GLWESecretPrepared::alloc_bytes(module, infos.rank_out())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ impl GLWESwitchingKey<Vec<u8>> {
|
||||
{
|
||||
(GGLWE::encrypt_sk_scratch_space(module, infos) | ScalarZnx::alloc_bytes(module.n(), 1))
|
||||
+ ScalarZnx::alloc_bytes(module.n(), infos.rank_in().into())
|
||||
+ GLWESecretPrepared::alloc_bytes(module, &infos.glwe_layout())
|
||||
+ GLWESecretPrepared::alloc_bytes_from_infos(module, &infos.glwe_layout())
|
||||
}
|
||||
|
||||
pub fn encrypt_pk_scratch_space<B: Backend, A>(module: &Module<B>, _infos: &A) -> usize
|
||||
|
||||
@@ -23,7 +23,7 @@ impl TensorKey<Vec<u8>> {
|
||||
Module<B>:
|
||||
SvpPPolAllocBytes + VecZnxNormalizeTmpBytes + VecZnxDftAllocBytes + VecZnxNormalizeTmpBytes + VecZnxBigAllocBytes,
|
||||
{
|
||||
GLWESecretPrepared::alloc_bytes_with(module, infos.rank_out())
|
||||
GLWESecretPrepared::alloc_bytes(module, infos.rank_out())
|
||||
+ module.vec_znx_dft_alloc_bytes(infos.rank_out().into(), 1)
|
||||
+ module.vec_znx_big_alloc_bytes(1, 1)
|
||||
+ module.vec_znx_dft_alloc_bytes(1, 1)
|
||||
|
||||
@@ -22,7 +22,7 @@ impl GLWEToLWESwitchingKey<Vec<u8>> {
|
||||
A: GGLWEInfos,
|
||||
Module<B>: SvpPPolAllocBytes + VecZnxNormalizeTmpBytes + VecZnxDftAllocBytes + VecZnxNormalizeTmpBytes,
|
||||
{
|
||||
GLWESecretPrepared::alloc_bytes_with(module, infos.rank_in())
|
||||
GLWESecretPrepared::alloc_bytes(module, infos.rank_in())
|
||||
+ (GLWESwitchingKey::encrypt_sk_scratch_space(module, infos)
|
||||
| GLWESecret::alloc_bytes_with(infos.n(), infos.rank_in()))
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ impl LWESwitchingKey<Vec<u8>> {
|
||||
"rank_out > 1 is not supported for LWESwitchingKey"
|
||||
);
|
||||
GLWESecret::alloc_bytes_with(Degree(module.n() as u32), Rank(1))
|
||||
+ GLWESecretPrepared::alloc_bytes_with(module, Rank(1))
|
||||
+ GLWESecretPrepared::alloc_bytes(module, Rank(1))
|
||||
+ GLWESwitchingKey::encrypt_sk_scratch_space(module, infos)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user