added test for automorphism on automorphism key

This commit is contained in:
Jean-Philippe Bossuat
2025-05-19 14:05:20 +02:00
parent 13e26c8152
commit b9cc210793
7 changed files with 161 additions and 20 deletions

View File

@@ -405,6 +405,19 @@ fn test_external_product(log_n: usize, basek: usize, k: usize, sigma: f64, rank_
// gglwe_(m) (x) RGSW_(X^k) = gglwe_(m * X^k)
ct_gglwe_out.external_product(&module, &ct_gglwe_in, &ct_rgsw, scratch.borrow());
scratch = ScratchOwned::new(
GLWESwitchingKey::encrypt_sk_scratch_space(&module, rank_out, ct_gglwe_in.size())
| GLWECiphertextFourier::decrypt_scratch_space(&module, ct_gglwe_out.size())
| GLWESwitchingKey::external_product_scratch_space(
&module,
ct_gglwe_out.size(),
ct_gglwe_in.size(),
ct_rgsw.size(),
rank_out,
)
| GGSWCiphertext::encrypt_sk_scratch_space(&module, rank_out, ct_rgsw.size()),
);
let mut ct_glwe_dft: GLWECiphertextFourier<Vec<u8>, FFT64> = GLWECiphertextFourier::new(&module, basek, k, rank_out);
let mut pt: GLWEPlaintext<Vec<u8>> = GLWEPlaintext::new(&module, basek, k);