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