diff --git a/native/src/seal/ciphertext.cpp b/native/src/seal/ciphertext.cpp index c21d17366..32de30f6c 100644 --- a/native/src/seal/ciphertext.cpp +++ b/native/src/seal/ciphertext.cpp @@ -275,7 +275,10 @@ namespace seal double scale = 0; stream.read(reinterpret_cast(&scale), sizeof(double)); uint64_t correction_factor = 1; - stream.read(reinterpret_cast(&correction_factor), sizeof(uint64_t)); + if (version.major == 4) + { + stream.read(reinterpret_cast(&correction_factor), sizeof(uint64_t)); + } // Set values already at this point for the metadata validity check new_data.parms_id_ = parms_id; diff --git a/native/src/seal/serialization.h b/native/src/seal/serialization.h index deee6261d..2255ed644 100644 --- a/native/src/seal/serialization.h +++ b/native/src/seal/serialization.h @@ -150,16 +150,16 @@ namespace seal } // Different major versions not supported - if (header.version_major != SEAL_VERSION_MAJOR) + if (header.version_major != SEAL_VERSION_MAJOR && header.version_major != 3) { return false; } - // // Support Microsoft SEAL 3.4 and above - // if (header.version_major == 3 && header.version_minor >= 4) - // { - // return true; - // } + // Support Microsoft SEAL 3.4 and above + if (header.version_major == 3 && header.version_minor >= 4) + { + return true; + } return false; }