arnaucube
arnaucube/poulpyPublic Self-hosted repository
poulpy/core/src/glwe/tests/generic_serialization.rs
core/src/glwe/tests/generic_serialization.rsRaw
 1use backend::hal::{
 2    api::VecZnxAlloc,
 3    layouts::{Backend, Module},
 4    tests::serialization::test_reader_writer_interface,
 5};
 6
 7use crate::{GLWECiphertext, GLWECiphertextCompressed};
 8
 9pub(crate) fn test_serialization<B: Backend>(module: &Module<B>)
10where
11    Module<B>: VecZnxAlloc,
12{
13    let original: GLWECiphertext<Vec<u8>> = GLWECiphertext::alloc(module, 12, 54, 3);
14    test_reader_writer_interface(original);
15}
16
17pub(crate) fn test_serialization_compressed<B: Backend>(module: &Module<B>)
18where
19    Module<B>: VecZnxAlloc,
20{
21    let original: GLWECiphertextCompressed<Vec<u8>> = GLWECiphertextCompressed::alloc(module, 12, 54, 3);
22    test_reader_writer_interface(original);
23}