This commit is contained in:
Pro7ech
2025-10-12 21:34:10 +02:00
parent f72363cc4b
commit 662e533eac
32 changed files with 1594 additions and 787 deletions

View File

@@ -4,7 +4,7 @@ use crate::layouts::{
Base2K, Degree, Dnum, Dsize, GGLWEAutomorphismKey, GGLWECiphertext, GGLWESwitchingKey, GGLWETensorKey, GGSWCiphertext,
GLWECiphertext, GLWEToLWEKey, LWECiphertext, LWESwitchingKey, LWEToGLWESwitchingKey, Rank, TorusPrecision,
compressed::{
GGLWEAutomorphismKeyCompressed, GGLWECiphertextCompressed, GGLWESwitchingKeyCompressed, GGLWETensorKeyCompressed,
GGLWEAutomorphismKeyCompressed, GGLWECiphertextCompressed, GGLWEKeyCompressed, GGLWETensorKeyCompressed,
GGSWCiphertextCompressed, GLWECiphertextCompressed, GLWEToLWESwitchingKeyCompressed, LWECiphertextCompressed,
LWESwitchingKeyCompressed, LWEToGLWESwitchingKeyCompressed,
},
@@ -63,8 +63,7 @@ fn test_glwe_switching_key_serialization() {
#[test]
fn test_glwe_switching_key_compressed_serialization() {
let original: GGLWESwitchingKeyCompressed<Vec<u8>> =
GGLWESwitchingKeyCompressed::alloc_with(N_GLWE, BASE2K, K, RANK, RANK, DNUM, DSIZE);
let original: GGLWEKeyCompressed<Vec<u8>> = GGLWEKeyCompressed::alloc_with(N_GLWE, BASE2K, K, RANK, RANK, DNUM, DSIZE);
test_reader_writer_interface(original);
}

View File

@@ -18,7 +18,7 @@ use crate::{
encryption::SIGMA,
layouts::{
GGLWECiphertextLayout, GGLWESwitchingKey, GLWESecret,
compressed::{Decompress, GGLWESwitchingKeyCompressed},
compressed::{Decompress, GGLWEKeyCompressed},
prepared::{GLWESecretPrepared, PrepareAlloc},
},
};
@@ -173,12 +173,12 @@ where
rank_out: rank_out.into(),
};
let mut ksk_compressed: GGLWESwitchingKeyCompressed<Vec<u8>> = GGLWESwitchingKeyCompressed::alloc(&gglwe_infos);
let mut ksk_compressed: GGLWEKeyCompressed<Vec<u8>> = GGLWEKeyCompressed::alloc(&gglwe_infos);
let mut source_xs: Source = Source::new([0u8; 32]);
let mut source_xe: Source = Source::new([0u8; 32]);
let mut scratch: ScratchOwned<B> = ScratchOwned::alloc(GGLWESwitchingKeyCompressed::encrypt_sk_scratch_space(
let mut scratch: ScratchOwned<B> = ScratchOwned::alloc(GGLWEKeyCompressed::encrypt_sk_scratch_space(
module,
&gglwe_infos,
));

View File

@@ -363,7 +363,7 @@ where
let sk_prepared: GLWESecretPrepared<Vec<u8>, B> = sk.prepare_alloc(module, scratch.borrow());
let mut pk: GLWEPublicKey<Vec<u8>> = GLWEPublicKey::alloc(&glwe_infos);
pk.generate_from_sk(module, &sk_prepared, &mut source_xa, &mut source_xe);
pk.generate(module, &sk_prepared, &mut source_xa, &mut source_xe);
module.vec_znx_fill_uniform(base2k, &mut pt_want.data, 0, &mut source_xa);