This commit is contained in:
Pro7ech
2025-10-13 23:49:09 +02:00
parent d32b4738c3
commit 0533cdff8a
27 changed files with 776 additions and 2022 deletions

View File

@@ -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())
}
}

View File

@@ -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

View File

@@ -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)

View File

@@ -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()))
}

View File

@@ -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)
}
}