Skip to content

Commit

Permalink
Added support to load objects serialized by SEAL v3.4+.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wei Dai committed Mar 17, 2022
1 parent fda6250 commit 8d31897
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion native/src/seal/ciphertext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,10 @@ namespace seal
double scale = 0;
stream.read(reinterpret_cast<char *>(&scale), sizeof(double));
uint64_t correction_factor = 1;
stream.read(reinterpret_cast<char *>(&correction_factor), sizeof(uint64_t));
if (version.major == 4)
{
stream.read(reinterpret_cast<char *>(&correction_factor), sizeof(uint64_t));
}

// Set values already at this point for the metadata validity check
new_data.parms_id_ = parms_id;
Expand Down
12 changes: 6 additions & 6 deletions native/src/seal/serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8d31897

Please sign in to comment.