use poulpy_hal::test_suite::serialization::test_reader_writer_interface; use crate::layouts::{ GGLWEAutomorphismKey, GGLWECiphertext, GGLWESwitchingKey, GGLWETensorKey, GGSWCiphertext, GLWECiphertext, GLWEToLWESwitchingKey, LWECiphertext, LWESwitchingKey, LWEToGLWESwitchingKey, compressed::{ GGLWEAutomorphismKeyCompressed, GGLWECiphertextCompressed, GGLWESwitchingKeyCompressed, GGLWETensorKeyCompressed, GGSWCiphertextCompressed, GLWECiphertextCompressed, GLWEToLWESwitchingKeyCompressed, LWECiphertextCompressed, LWESwitchingKeyCompressed, LWEToGLWESwitchingKeyCompressed, }, }; const N_GLWE: usize = 64; const N_LWE: usize = 32; const BASEK: usize = 12; const K: usize = 33; const ROWS: usize = 2; const RANK: usize = 2; const DIGITS: usize = 1; #[test] fn glwe_serialization() { let original: GLWECiphertext> = GLWECiphertext::alloc(N_GLWE, BASEK, K, RANK); poulpy_hal::test_suite::serialization::test_reader_writer_interface(original); } #[test] fn glwe_compressed_serialization() { let original: GLWECiphertextCompressed> = GLWECiphertextCompressed::alloc(N_GLWE, BASEK, K, RANK); test_reader_writer_interface(original); } #[test] fn lwe_serialization() { let original: LWECiphertext> = LWECiphertext::alloc(N_LWE, BASEK, K); test_reader_writer_interface(original); } #[test] fn lwe_compressed_serialization() { let original: LWECiphertextCompressed> = LWECiphertextCompressed::alloc(BASEK, K); test_reader_writer_interface(original); } #[test] fn test_gglwe_serialization() { let original: GGLWECiphertext> = GGLWECiphertext::alloc(1024, 12, 54, 3, 1, 2, 2); test_reader_writer_interface(original); } #[test] fn test_gglwe_compressed_serialization() { let original: GGLWECiphertextCompressed> = GGLWECiphertextCompressed::alloc(1024, 12, 54, 3, 1, 2, 2); test_reader_writer_interface(original); } #[test] fn test_glwe_switching_key_serialization() { let original: GGLWESwitchingKey> = GGLWESwitchingKey::alloc(1024, 12, 54, 3, 1, 2, 2); test_reader_writer_interface(original); } #[test] fn test_glwe_switching_key_compressed_serialization() { let original: GGLWESwitchingKeyCompressed> = GGLWESwitchingKeyCompressed::alloc(1024, 12, 54, 3, 1, 2, 2); test_reader_writer_interface(original); } #[test] fn test_automorphism_key_serialization() { let original: GGLWEAutomorphismKey> = GGLWEAutomorphismKey::alloc(1024, 12, 54, 3, 1, 2); test_reader_writer_interface(original); } #[test] fn test_automorphism_key_compressed_serialization() { let original: GGLWEAutomorphismKeyCompressed> = GGLWEAutomorphismKeyCompressed::alloc(1024, 12, 54, 3, 1, 2); test_reader_writer_interface(original); } #[test] fn test_tensor_key_serialization() { let original: GGLWETensorKey> = GGLWETensorKey::alloc(1024, 12, 54, 3, 1, 2); test_reader_writer_interface(original); } #[test] fn test_tensor_key_compressed_serialization() { let original: GGLWETensorKeyCompressed> = GGLWETensorKeyCompressed::alloc(1024, 12, 54, 3, 1, 2); test_reader_writer_interface(original); } #[test] fn glwe_to_lwe_switching_key_serialization() { let original: GLWEToLWESwitchingKey> = GLWEToLWESwitchingKey::alloc(N_GLWE, BASEK, K, ROWS, RANK); test_reader_writer_interface(original); } #[test] fn glwe_to_lwe_switching_key_compressed_serialization() { let original: GLWEToLWESwitchingKeyCompressed> = GLWEToLWESwitchingKeyCompressed::alloc(N_GLWE, BASEK, K, ROWS, RANK); test_reader_writer_interface(original); } #[test] fn lwe_to_glwe_switching_key_serialization() { let original: LWEToGLWESwitchingKey> = LWEToGLWESwitchingKey::alloc(N_GLWE, BASEK, K, ROWS, RANK); test_reader_writer_interface(original); } #[test] fn lwe_to_glwe_switching_key_compressed_serialization() { let original: LWEToGLWESwitchingKeyCompressed> = LWEToGLWESwitchingKeyCompressed::alloc(N_GLWE, BASEK, K, ROWS, RANK); test_reader_writer_interface(original); } #[test] fn lwe_switching_key_serialization() { let original: LWESwitchingKey> = LWESwitchingKey::alloc(N_GLWE, BASEK, K, ROWS); test_reader_writer_interface(original); } #[test] fn lwe_switching_key_compressed_serialization() { let original: LWESwitchingKeyCompressed> = LWESwitchingKeyCompressed::alloc(N_GLWE, BASEK, K, ROWS); test_reader_writer_interface(original); } #[test] fn ggsw_serialization() { let original: GGSWCiphertext> = GGSWCiphertext::alloc(N_GLWE, BASEK, K, ROWS, DIGITS, RANK); test_reader_writer_interface(original); } #[test] fn ggsw_compressed_serialization() { let original: GGSWCiphertextCompressed> = GGSWCiphertextCompressed::alloc(N_GLWE, BASEK, K, ROWS, DIGITS, RANK); test_reader_writer_interface(original); }