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

Add nonce masking operation to PaillierEncryptionKey #124

Merged
merged 3 commits into from
Jan 26, 2023
Merged

Conversation

amaloz
Copy link

@amaloz amaloz commented Jan 20, 2023

This PR adds a new PaillierEncryptionKey::mask method, which takes two nonces and produces a masked nonce. It also threads the MaskedNonce type through the ZKPs, although currently we still use .0 to extract the underlying BigNumber. This will change once we add some additional functionality for operating on MaskedNonces (#107).

Closes #118.

This commit adds a new `PaillierEncryptionKey::mask` method, which
takes two nonces and produces a masked nonce. It also threads the
`MaskedNonce` type through the ZKPs, although currently we still use
`.0` to extract the underlying `BigNumber`. This will change once we
add some additional functionality for operating on `MaskedNonce`s.
Copy link

@marsella marsella left a comment

Choose a reason for hiding this comment

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

Code changes look good. I have a few comments about documentation.

src/paillier.rs Outdated Show resolved Hide resolved
src/paillier.rs Outdated Show resolved Hide resolved
src/paillier.rs Outdated Show resolved Hide resolved
src/zkp/pienc.rs Outdated Show resolved Hide resolved
@amaloz
Copy link
Author

amaloz commented Jan 23, 2023

@marsella Should be ready for another review!

Copy link

@marsella marsella left a comment

Choose a reason for hiding this comment

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

My renaming request introduced a bug! I should have been clearer that I didn't know which nonce was the mask and which was the nonce 😁

src/paillier.rs Show resolved Hide resolved
src/paillier.rs Outdated Show resolved Hide resolved
The `nonce` and `mask` were flipped around. To keep the API clean we
still keep the argument order but rather change the callers to call
`mask` correctly.
src/paillier.rs Show resolved Hide resolved
@amaloz amaloz merged commit 3f170e7 into main Jan 26, 2023
@marsella marsella deleted the issue-118 branch January 26, 2023 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add mask method to PaillierNonce
2 participants