arnaucube
arnaucube/poulpyPublic Self-hosted repository
poulpy/core/src/gglwe/tests/generic_serialization.rs
core/src/gglwe/tests/generic_serialization.rsRaw
 1use backend::hal::tests::serialization::test_reader_writer_interface;
 2
 3use crate::{
 4    AutomorphismKey, AutomorphismKeyCompressed, GGLWECiphertext, GGLWECiphertextCompressed, GLWESwitchingKey,
 5    GLWESwitchingKeyCompressed, GLWETensorKey, GLWETensorKeyCompressed,
 6};
 7
 8#[test]
 9fn test_gglwe_serialization() {
10    let original: GGLWECiphertext<Vec<u8>> = GGLWECiphertext::alloc(1024, 12, 54, 3, 1, 2, 2);
11    test_reader_writer_interface(original);
12}
13
14#[test]
15fn test_gglwe_compressed_serialization() {
16    let original: GGLWECiphertextCompressed<Vec<u8>> = GGLWECiphertextCompressed::alloc(1024, 12, 54, 3, 1, 2, 2);
17    test_reader_writer_interface(original);
18}
19
20#[test]
21fn test_glwe_switching_key_serialization() {
22    let original: GLWESwitchingKey<Vec<u8>> = GLWESwitchingKey::alloc(1024, 12, 54, 3, 1, 2, 2);
23    test_reader_writer_interface(original);
24}
25
26#[test]
27fn test_glwe_switching_key_compressed_serialization() {
28    let original: GLWESwitchingKeyCompressed<Vec<u8>> = GLWESwitchingKeyCompressed::alloc(1024, 12, 54, 3, 1, 2, 2);
29    test_reader_writer_interface(original);
30}
31
32#[test]
33fn test_automorphism_key_serialization() {
34    let original: AutomorphismKey<Vec<u8>> = AutomorphismKey::alloc(1024, 12, 54, 3, 1, 2);
35    test_reader_writer_interface(original);
36}
37
38#[test]
39fn test_automorphism_key_compressed_serialization() {
40    let original: AutomorphismKeyCompressed<Vec<u8>> = AutomorphismKeyCompressed::alloc(1024, 12, 54, 3, 1, 2);
41    test_reader_writer_interface(original);
42}
43
44#[test]
45fn test_tensor_key_serialization() {
46    let original: GLWETensorKey<Vec<u8>> = GLWETensorKey::alloc(1024, 12, 54, 3, 1, 2);
47    test_reader_writer_interface(original);
48}
49
50#[test]
51fn test_tensor_key_compressed_serialization() {
52    let original: GLWETensorKeyCompressed<Vec<u8>> = GLWETensorKeyCompressed::alloc(1024, 12, 54, 3, 1, 2);
53    test_reader_writer_interface(original);
54}