Optimize homomorphic encryption (precomputations and other optimizations)#30
Draft
jellevos wants to merge 4 commits into
Draft
Optimize homomorphic encryption (precomputations and other optimizations)#30jellevos wants to merge 4 commits into
jellevos wants to merge 4 commits into
Conversation
JSAbrahams
reviewed
May 26, 2022
| /// ``` | ||
| fn generate_keys<R: SecureRng>(&self, rng: &mut GeneralRng<R>) -> (PaillierPK, PaillierSK) { | ||
| let (n, lambda) = gen_rsa_modulus(self.modulus_size, rng); | ||
| let (n, lambda, _, _) = gen_rsa_modulus(self.modulus_size, rng); |
There was a problem hiding this comment.
You can actually use .. shorthand here: let (n, lambda, ..) =
|
|
||
| /// Compresses the precomputed secret key to a smaller format without precomputations | ||
| pub fn compress(self) -> CompressedRsaSK { | ||
| CompressedRsaSK { |
There was a problem hiding this comment.
Cool rust feature, you can use ...self shorthand in cases like this
CompressedRsaSK { ...self }
But this is a draft so i'm guessing this method isn't complete ofc
| fn decrypt_raw(&self, public_key: &PK, ciphertext: &PK::Ciphertext) -> PK::Plaintext; | ||
|
|
||
| /// Uses both the secret material from the decryption key and the encryption key to encrypt faster than with only the encryption key. | ||
| /// This method is always implemented, but it defaults to simply encrypting without the secret key. |
There was a problem hiding this comment.
Hm, maybe I misunderstand, but if this is a trait, is there a need to specify that this method is always implemented?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paillier:
n_squaredn_squared