Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements for better Rust compatibility #724

Closed
wants to merge 4 commits into from

Conversation

nkaskov
Copy link
Collaborator

@nkaskov nkaskov commented Mar 27, 2024

In this PR, we bring minor interface improvements in order to achieve better compatibility with the Rust binding we are building.

The changes brought by this PR:

@nkaskov nkaskov changed the title [Draft] Minor improvement for better Rust compatibility [Draft] Minor improvements for better Rust compatibility Mar 29, 2024
@yspolyakov
Copy link
Contributor

@nkaskov Just want to confirm that this change is needed for Rust compatibility. I see changes in some example, implying that the user API has changed (unexpected behavior for v1.1.5), which may lead to compilation errors for existing projects based on OpenFHE.

Maybe it would be safer to add "is_allocated" w/o removing "good", so that the code would backwards compatible. In general, we only change API during major releases. Is this change required for the Rust bindings?

@nkaskov
Copy link
Collaborator Author

nkaskov commented Apr 19, 2024

Maybe it would be safer to add "is_allocated" w/o removing "good", so that the code would backwards compatible. In general, we only change API during major releases. Is this change required for the Rust bindings?

Hi @yspolyakov! Thanks for your contribution. We decided to go with proposed solution and added is_allocated(), keeping good() method for the backward compatibility. The good() method has exactly the same interface as before, and is_allocated() has the interface required by the Rust binding.

@nkaskov nkaskov force-pushed the main branch 2 times, most recently from c2c90af to 5694273 Compare April 19, 2024 10:55
@nkaskov nkaskov requested a review from yspolyakov April 19, 2024 10:59
@nkaskov nkaskov marked this pull request as ready for review April 19, 2024 10:59
@nkaskov nkaskov changed the title [Draft] Minor improvements for better Rust compatibility Minor improvements for better Rust compatibility Apr 19, 2024
@yspolyakov yspolyakov added this to the Release 1.1.5 milestone Apr 19, 2024
@@ -56,6 +56,7 @@ class CCParams<CryptoContextCKKSRNS> : public Params {
public:
CCParams() : Params(CKKSRNS_SCHEME) {}
explicit CCParams(const std::vector<std::string>& vals) : Params(vals) {}
explicit CCParams(const Params& params) : Params(params) {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need this constructor

@@ -56,6 +56,7 @@ class CCParams<CryptoContextBGVRNS> : public Params {
public:
CCParams() : Params(BGVRNS_SCHEME) {}
explicit CCParams(const std::vector<std::string>& vals) : Params(vals) {}
explicit CCParams(const Params& params) : Params(params) {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need this constructor

@@ -56,6 +56,7 @@ class CCParams<CryptoContextBFVRNS> : public Params {
public:
CCParams() : Params(BFVRNS_SCHEME) {}
explicit CCParams(const std::vector<std::string>& vals) : Params(vals) {}
explicit CCParams(const Params& params) : Params(params) {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need this constructor

src/pke/include/key/keypair.h Show resolved Hide resolved
@@ -0,0 +1,136 @@
//==================================================================================
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am aware about this situation, but didn't have time to fix it. it will be resolved differently, without creating a new file. just a few line code change

@dsuponitskiy
Copy link
Collaborator

a new PR has been submitted instead of this one. see it here: #755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants